Header error using boost.regex 1.32 built using vc6

Hi Folks, I'm a newbie gingerly moving over from MFC. I have built and installed regex from the boost_1_32_0 package without any obvious problem. Now I've included the simplest use of regex taken from the overview and: a) I get a compile error in regbase.hpp. As a temporary workaround I've tried using V3 instead and: b) I get a link error (debug & release) Can someone help me overcome this please? Many thanks. I have: #include <boost/cregex.hpp> //#define BOOST_REGEX_V3 #include <boost/regex.hpp> using namespace boost; ... // regexp test const std::string s = "sdflsjhslad"; static const boost::regex e("(\\d{4}[- ]){3}\\d{4}"); if (regex_match(s, e)) ASSERT(true); else; ASSERT(true); ... which gives the following: Compiling... StdWbApp.cpp c:\projects\boost_1_32_0\boost\regex\v4\regbase.hpp(120) : error C2955: 'collate' : use of class template requires template argument list c:\program files\microsoft visual studio\vc98\include\locale(67) : see declaration of 'collate' c:\projects\boost_1_32_0\boost\type_traits\detail\wrap.hpp(16) : fatal error C1506: unrecoverable block scoping error and if I use V3 I get the link errors: StdWbApp.cpp Linking... StdWbApp.obj : error LNK2001: unresolved external symbol "protected: void __cdecl boost::re_detail::match_results_base<char const *,class boost::detail::allocator_adapter<char,class boost::detail::simple_alloc>
::m_free(void)" (?m_free@?$match_resu lts_base@PBDV?$allocator_adapter@DVsimple_alloc@detail@boost@@@detail@boost@@@re_detail@boost@@IAAXXZ) StdWbApp.obj : error LNK2001: unresolved external symbol "public: __thiscall boost::re_detail::match_results_base<char const *,class boost::detail::allocator_adapter<char,class boost::detail::simple_alloc> ::match_results_base<char const *,class bo ost::detail::allocator_adapter<char,class boost::detail::simple_alloc> (class boost::detail::allocator_adapter<char,class boost::detail::simple_alloc> const &)" (??0?$match_results_base@PBDV?$allocator_adapter@DVsimple_alloc@detail@boost@@@detail@b oost@@@re_detail@boost@@QAE@ABV?$allocator_adapter@DVsimple_alloc@detail@boost@@@detail@2@@Z) StdWbApp.obj : error LNK2001: unresolved external symbol "public: void __cdecl boost::re_detail::match_results_base<char const *,class boost::detail::allocator_adapter<char,class boost::detail::simple_alloc> ::set_size(unsigned int,char const *,cha r const *)" (?set_size@?$match_results_base@PBDV?$allocator_adapter@DVsimple_alloc@detail@boost@@@detail@boost@@@re_detail@boost@@QAAXIPBD0@Z) ... and so on
Debug/StdWb.exe : fatal error LNK1120: 9 unresolved externals

Mea culpa. My test program had a preceding header that included "using namespace std;". I'd read it was bad practice, now I know why. Sorry to waste your time.
participants (1)
-
Martyn Woerner