how to get regex to link in windows?

Another frustrating day trying to compile some code... I'm trying use the regex library. My application is compiled using Multi-threaded Debug DLL (/MDd). I specified the following library libboost_regex-vc71-mt.lib and all I get are link errors. My application is a console app so I defined BOOST_REGEX_NO_W32 I've tried setting BOOST_REGEX_DYN_LINK and BOOST_REGEX_NO_LIB but that doesn't cut it. The funny thing is that Im also using the filesystem library, and I link with the same type of library libboost_filesystem-vc71-mt.lib and I don't get any problems with the compiler. I'd appreciate if someone can point out what I'm doing wrong. Thanks, Alexis Try #1: Defining BOOST_REGEX_DYN_LINK BOOST_REGEX_NO_LIB BOOST_LIB_DIAGNOSTIC BOOST_REGEX_NO_W32 Specifying as the link libraries libboost_filesystem-vc71-mt.lib libboost_regex-vc71-mt.lib Linking to lib file: libboost_filesystem-vc71-mt-gd-1_32.lib Linking to lib file: boost_regex-vc71-mt-gd-1_32.lib Linking... test_csfwrapper.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void * __cdecl boost::re_detail::get_mem_block(void)" (__imp_?get_mem_block@re_detail@boost@@YAPAXXZ) referenced in function "public: __thiscall boost::re_detail::save_state_init::save_state_init(struct boost::re_detail::saved_state * *,struct boost::re_detail::saved_state * *)" (??0save_state_init@re_detail@boost@@QAE@PAPAUsaved_state@12@0@Z) test_csfwrapper.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl boost::re_detail::put_mem_block(void *)" (__imp_?put_mem_block@re_detail@boost@@YAXPAX@Z) referenced in function "public: __thiscall boost::re_detail::save_state_init::~save_state_init(void)" (??1save_state_init@re_detail@boost@@QAE@XZ) Try #2: Defining BOOST_LIB_DIAGNOSTIC BOOST_REGEX_NO_W32 Linking to lib file: libboost_filesystem-vc71-mt-gd-1_32.lib Linking to lib file: libboost_regex-vc71-mt-gd-1_32.lib Linking... libboost_regex-vc71-mt-gd-1_32.lib(regex.obj) : error LNK2005: "public: virtual __thiscall boost::bad_pattern::~bad_pattern(void)" (??1bad_pattern@boost@@UAE@XZ) already defined in libboost_regex-vc71-mt.lib(regex.obj) libboost_regex-vc71-mt-gd-1_32.lib(regex.obj) : error LNK2005: "public: virtual __thiscall boost::bad_expression::~bad_expression(void)" (??1bad_expression@boost@@UAE@XZ) already defined in libboost_regex-vc71-mt.lib(regex.obj) libboost_regex-vc71-mt-gd-1_32.lib(regex.obj) : error LNK2005: "public: __thiscall boost::regbase::regbase(void)" (??0regbase@boost@@QAE@XZ) already defined in libboost_regex-vc71-mt.lib(regex.obj) libboost_regex-vc71-mt-gd-1_32.lib(regex.obj) : error LNK2005: "public: __thiscall boost::regbase::regbase(class boost::regbase const &)" (??0regbase@boost@@QAE@ABV01@@Z) already defined in libboost_regex-vc71-mt.lib(regex.obj) libboost_regex-vc71-mt-gd-1_32.lib(c_regex_traits.obj) : error LNK2005: "protected: static char * boost::re_detail::c_traits_base::regex_message_catalogue" (?regex_message_catalogue@c_traits_base@re_detail@boost@@1PADA) already defined in libboost_regex-vc71-mt.lib(c_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(c_regex_traits.obj) : error LNK2005: "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > * `anonymous namespace'::wlocale_name" (?wlocale_name@?A0xe5354fb3@@3PAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A) already defined in libboost_regex-vc71-mt.lib(c_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(c_regex_traits.obj) : error LNK2005: "unsigned int `anonymous namespace'::nlsw_count" (?nlsw_count@?A0xe5354fb3@@3IA) already defined in libboost_regex-vc71-mt.lib(c_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(c_regex_traits.obj) : error LNK2005: "unsigned int `anonymous namespace'::entry_count" (?entry_count@?A0xe5354fb3@@3IA) already defined in libboost_regex-vc71-mt.lib(c_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(c_regex_traits.obj) : error LNK2005: "char * * `anonymous namespace'::re_custom_error_messages" (?re_custom_error_messages@?A0xe5354fb3@@3PAPADA) already defined in libboost_regex-vc71-mt.lib(c_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(c_regex_traits.obj) : error LNK2005: "unsigned int `anonymous namespace'::message_count" (?message_count@?A0xe5354fb3@@3IA) already defined in libboost_regex-vc71-mt.lib(c_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(c_regex_traits.obj) : error LNK2005: "unsigned int `anonymous namespace'::collate_count" (?collate_count@?A0xe5354fb3@@3IA) already defined in libboost_regex-vc71-mt.lib(c_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(c_regex_traits.obj) : error LNK2005: "unsigned int `anonymous namespace'::classes_count" (?classes_count@?A0xe5354fb3@@3IA) already defined in libboost_regex-vc71-mt.lib(c_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(c_regex_traits.obj) : error LNK2005: "char const * * `anonymous namespace'::re_char_class_names" (?re_char_class_names@?A0xe5354fb3@@3PAPBDA) already defined in libboost_regex-vc71-mt.lib(c_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(c_regex_traits.obj) : error LNK2005: "unsigned long * `anonymous namespace'::re_char_class_id" (?re_char_class_id@?A0xe5354fb3@@3PAKA) already defined in libboost_regex-vc71-mt.lib(c_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(c_regex_traits.obj) : error LNK2005: "char `anonymous namespace'::re_ten" (?re_ten@?A0xe5354fb3@@3DA) already defined in libboost_regex-vc71-mt.lib(c_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(c_regex_traits.obj) : error LNK2005: "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > * `anonymous namespace'::re_coll_name" (?re_coll_name@?A0xe5354fb3@@3PAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A) already defined in libboost_regex-vc71-mt.lib(c_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(c_regex_traits.obj) : error LNK2005: "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > * `anonymous namespace'::collate_name" (?collate_name@?A0xe5354fb3@@3PAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A) already defined in libboost_regex-vc71-mt.lib(c_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(c_regex_traits.obj) : error LNK2005: "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > * `anonymous namespace'::mess_locale" (?mess_locale@?A0xe5354fb3@@3PAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A) already defined in libboost_regex-vc71-mt.lib(c_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(c_regex_traits.obj) : error LNK2005: "wchar_t `anonymous namespace'::re_ten_w" (?re_ten_w@?A0xe5354fb3@@3_WA) already defined in libboost_regex-vc71-mt.lib(c_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(c_regex_traits.obj) : error LNK2005: "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > * `anonymous namespace'::pclasses" (?pclasses@?A0xe5354fb3@@3PAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A) already defined in libboost_regex-vc71-mt.lib(c_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(c_regex_traits.obj) : error LNK2005: "char `anonymous namespace'::re_zero" (?re_zero@?A0xe5354fb3@@3DA) already defined in libboost_regex-vc71-mt.lib(c_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(c_regex_traits.obj) : error LNK2005: "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > * `anonymous namespace'::ctype_name" (?ctype_name@?A0xe5354fb3@@3PAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A) already defined in libboost_regex-vc71-mt.lib(c_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(c_regex_traits.obj) : error LNK2005: "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > * `anonymous namespace'::re_cls_name" (?re_cls_name@?A0xe5354fb3@@3PAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A) already defined in libboost_regex-vc71-mt.lib(c_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(c_regex_traits.obj) : error LNK2005: "class std::list<struct `anonymous namespace'::collate_name_t,class std::allocator<struct `anonymous namespace'::collate_name_t> > * `anonymous namespace'::pcoll_names" (?pcoll_names@?A0xe5354fb3@@3PAV?$list@Ucollate_name_t@?A0xe5354fb3@@V?$allocator@Ucollate_name_t@?A0xe5354fb3@@@std@@@std@@A) already defined in libboost_regex-vc71-mt.lib(c_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(c_regex_traits.obj) : error LNK2005: "wchar_t `anonymous namespace'::re_zero_w" (?re_zero_w@?A0xe5354fb3@@3_WA) already defined in libboost_regex-vc71-mt.lib(c_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(c_regex_traits.obj) : error LNK2005: "class std::list<struct `anonymous namespace'::syntax_map_t,class std::allocator<struct `anonymous namespace'::syntax_map_t> > * `anonymous namespace'::syntax" (?syntax@?A0xe5354fb3@@3PAV?$list@Usyntax_map_t@?A0xe5354fb3@@V?$allocator@Usyntax_map_t@?A0xe5354fb3@@@std@@@std@@A) already defined in libboost_regex-vc71-mt.lib(c_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(c_regex_traits.obj) : error LNK2005: "private: static unsigned int boost::c_regex_traits<wchar_t>::sort_type" (?sort_type@?$c_regex_traits@_W@boost@@0IA) already defined in libboost_regex-vc71-mt.lib(c_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(c_regex_traits.obj) : error LNK2005: "private: static unsigned int boost::c_regex_traits<char>::sort_type" (?sort_type@?$c_regex_traits@D@boost@@0IA) already defined in libboost_regex-vc71-mt.lib(c_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(c_regex_traits.obj) : error LNK2005: "private: static wchar_t boost::c_regex_traits<wchar_t>::sort_delim" (?sort_delim@?$c_regex_traits@_W@boost@@0_WA) already defined in libboost_regex-vc71-mt.lib(c_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(c_regex_traits.obj) : error LNK2005: "protected: static unsigned short * boost::re_detail::c_traits_base::class_map" (?class_map@c_traits_base@re_detail@boost@@1PAGA) already defined in libboost_regex-vc71-mt.lib(c_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(c_regex_traits.obj) : error LNK2005: "protected: static char * boost::re_detail::c_traits_base::lower_case_map" (?lower_case_map@c_traits_base@re_detail@boost@@1PADA) already defined in libboost_regex-vc71-mt.lib(c_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(c_regex_traits.obj) : error LNK2005: "protected: static unsigned char * boost::re_detail::c_traits_base::syntax_map" (?syntax_map@c_traits_base@re_detail@boost@@1PAEA) already defined in libboost_regex-vc71-mt.lib(c_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(c_regex_traits.obj) : error LNK2005: "private: static char boost::c_regex_traits<char>::sort_delim" (?sort_delim@?$c_regex_traits@D@boost@@0DA) already defined in libboost_regex-vc71-mt.lib(c_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(c_regex_traits.obj) : error LNK2005: "char const * __cdecl `anonymous namespace'::re_get_locale(int)" (?re_get_locale@?A0xe5354fb3@@YAPBDH@Z) already defined in libboost_regex-vc71-mt.lib(c_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(c_regex_traits.obj) : error LNK2005: "private: static class boost::c_regex_traits<char> boost::c_regex_traits<char>::i" (?i@?$c_regex_traits@D@boost@@0V12@A) already defined in libboost_regex-vc71-mt.lib(c_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(c_regex_traits.obj) : error LNK2005: "private: static class boost::c_regex_traits<wchar_t> boost::c_regex_traits<wchar_t>::init_" (?init_@?$c_regex_traits@_W@boost@@0V12@A) already defined in libboost_regex-vc71-mt.lib(c_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(w32_regex_traits.obj) : error LNK2005: "private: static unsigned short * boost::w32_regex_traits<wchar_t>::wide_unicode_classes" (?wide_unicode_classes@?$w32_regex_traits@_W@boost@@0PAGA) already defined in libboost_regex-vc71-mt.lib(w32_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(w32_regex_traits.obj) : error LNK2005: "protected: static char * boost::re_detail::w32_traits_base::regex_message_catalogue" (?regex_message_catalogue@w32_traits_base@re_detail@boost@@1PADA) already defined in libboost_regex-vc71-mt.lib(w32_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(w32_regex_traits.obj) : error LNK2005: "bool `anonymous namespace'::isPlatformNT" (?isPlatformNT@?A0x07ed92d4@@3_NA) already defined in libboost_regex-vc71-mt.lib(w32_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(w32_regex_traits.obj) : error LNK2005: "bool `anonymous namespace'::is_init" (?is_init@?A0x07ed92d4@@3_NA) already defined in libboost_regex-vc71-mt.lib(w32_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(w32_regex_traits.obj) : error LNK2005: "unsigned int `anonymous namespace'::entry_count" (?entry_count@?A0x07ed92d4@@3IA) already defined in libboost_regex-vc71-mt.lib(w32_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(w32_regex_traits.obj) : error LNK2005: "char * * `anonymous namespace'::re_custom_error_messages" (?re_custom_error_messages@?A0x07ed92d4@@3PAPADA) already defined in libboost_regex-vc71-mt.lib(w32_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(w32_regex_traits.obj) : error LNK2005: "struct HINSTANCE__ * `anonymous namespace'::hresmod" (?hresmod@?A0x07ed92d4@@3PAUHINSTANCE__@@A) already defined in libboost_regex-vc71-mt.lib(w32_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(w32_regex_traits.obj) : error LNK2005: "class std::list<struct `anonymous namespace'::collate_name_t,class std::allocator<struct `anonymous namespace'::collate_name_t> > * `anonymous namespace'::pcoll_names" (?pcoll_names@?A0x07ed92d4@@3PAV?$list@Ucollate_name_t@?A0x07ed92d4@@V?$allocator@Ucollate_name_t@?A0x07ed92d4@@@std@@@std@@A) already defined in libboost_regex-vc71-mt.lib(w32_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(w32_regex_traits.obj) : error LNK2005: "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > * `anonymous namespace'::pclasses" (?pclasses@?A0x07ed92d4@@3PAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A) already defined in libboost_regex-vc71-mt.lib(w32_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(w32_regex_traits.obj) : error LNK2005: "char const * * `anonymous namespace'::re_char_class_names" (?re_char_class_names@?A0x07ed92d4@@3PAPBDA) already defined in libboost_regex-vc71-mt.lib(w32_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(w32_regex_traits.obj) : error LNK2005: "unsigned long * `anonymous namespace'::re_char_class_id" (?re_char_class_id@?A0x07ed92d4@@3PAKA) already defined in libboost_regex-vc71-mt.lib(w32_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(w32_regex_traits.obj) : error LNK2005: "char `anonymous namespace'::re_ten" (?re_ten@?A0x07ed92d4@@3DA) already defined in libboost_regex-vc71-mt.lib(w32_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(w32_regex_traits.obj) : error LNK2005: "wchar_t `anonymous namespace'::re_ten_w" (?re_ten_w@?A0x07ed92d4@@3_WA) already defined in libboost_regex-vc71-mt.lib(w32_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(w32_regex_traits.obj) : error LNK2005: "char `anonymous namespace'::re_zero" (?re_zero@?A0x07ed92d4@@3DA) already defined in libboost_regex-vc71-mt.lib(w32_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(w32_regex_traits.obj) : error LNK2005: "wchar_t `anonymous namespace'::re_zero_w" (?re_zero_w@?A0x07ed92d4@@3_WA) already defined in libboost_regex-vc71-mt.lib(w32_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(w32_regex_traits.obj) : error LNK2005: "class std::list<struct `anonymous namespace'::syntax_map_t,class std::allocator<struct `anonymous namespace'::syntax_map_t> > * `anonymous namespace'::syntax" (?syntax@?A0x07ed92d4@@3PAV?$list@Usyntax_map_t@?A0x07ed92d4@@V?$allocator@Usyntax_map_t@?A0x07ed92d4@@@std@@@std@@A) already defined in libboost_regex-vc71-mt.lib(w32_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(w32_regex_traits.obj) : error LNK2005: "protected: static unsigned short * boost::re_detail::w32_traits_base::class_map" (?class_map@w32_traits_base@re_detail@boost@@1PAGA) already defined in libboost_regex-vc71-mt.lib(w32_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(w32_regex_traits.obj) : error LNK2005: "protected: static unsigned char * boost::re_detail::w32_traits_base::syntax_map" (?syntax_map@w32_traits_base@re_detail@boost@@1PAEA) already defined in libboost_regex-vc71-mt.lib(w32_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(w32_regex_traits.obj) : error LNK2005: "protected: static char * boost::re_detail::w32_traits_base::lower_case_map" (?lower_case_map@w32_traits_base@re_detail@boost@@1PADA) already defined in libboost_regex-vc71-mt.lib(w32_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(w32_regex_traits.obj) : error LNK2005: "public: __thiscall boost::w32_regex_traits<char>::w32_regex_traits<char>(void)" (??0?$w32_regex_traits@D@boost@@QAE@XZ) already defined in libboost_regex-vc71-mt.lib(w32_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(w32_regex_traits.obj) : error LNK2005: "public: __thiscall boost::w32_regex_traits<char>::~w32_regex_traits<char>(void)" (??1?$w32_regex_traits@D@boost@@QAE@XZ) already defined in libboost_regex-vc71-mt.lib(w32_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(w32_regex_traits.obj) : error LNK2005: "public: __thiscall boost::w32_regex_traits<wchar_t>::w32_regex_traits<wchar_t>(void)" (??0?$w32_regex_traits@_W@boost@@QAE@XZ) already defined in libboost_regex-vc71-mt.lib(w32_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(w32_regex_traits.obj) : error LNK2005: "public: __thiscall boost::w32_regex_traits<wchar_t>::~w32_regex_traits<wchar_t>(void)" (??1?$w32_regex_traits@_W@boost@@QAE@XZ) already defined in libboost_regex-vc71-mt.lib(w32_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(w32_regex_traits.obj) : error LNK2005: "private: static class boost::w32_regex_traits<char> boost::w32_regex_traits<char>::i" (?i@?$w32_regex_traits@D@boost@@0V12@A) already defined in libboost_regex-vc71-mt.lib(w32_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(w32_regex_traits.obj) : error LNK2005: "private: static class boost::w32_regex_traits<wchar_t> boost::w32_regex_traits<wchar_t>::init_" (?init_@?$w32_regex_traits@_W@boost@@0V12@A) already defined in libboost_regex-vc71-mt.lib(w32_regex_traits.obj) libboost_regex-vc71-mt-gd-1_32.lib(c_regex_traits_common.obj) : error LNK2005: "wchar_t * boost::re_detail::wide_lower_case_map" (?wide_lower_case_map@re_detail@boost@@3PA_WA) already defined in libboost_regex-vc71-mt.lib(c_regex_traits_common.obj) libboost_regex-vc71-mt-gd-1_32.lib(c_regex_traits_common.obj) : error LNK2005: "unsigned short * boost::re_detail::wide_unicode_classes" (?wide_unicode_classes@re_detail@boost@@3PAGA) already defined in libboost_regex-vc71-mt.lib(c_regex_traits_common.obj) libboost_regex-vc71-mt-gd-1_32.lib(c_regex_traits_common.obj) : error LNK2005: "char const * * boost::re_detail::re_default_error_messages" (?re_default_error_messages@re_detail@boost@@3PAPBDA) already defined in libboost_regex-vc71-mt.lib(c_regex_traits_common.obj) libboost_regex-vc71-mt-gd-1_32.lib(c_regex_traits_common.obj) : error LNK2005: "char const * * boost::re_detail::def_multi_coll" (?def_multi_coll@re_detail@boost@@3PAPBDA) already defined in libboost_regex-vc71-mt.lib(c_regex_traits_common.obj) libboost_regex-vc71-mt-gd-1_32.lib(c_regex_traits_common.obj) : error LNK2005: "char const * * boost::re_detail::def_coll_names" (?def_coll_names@re_detail@boost@@3PAPBDA) already defined in libboost_regex-vc71-mt.lib(c_regex_traits_common.obj) libboost_regex-vc71-mt-gd-1_32.lib(regex_synch.obj) : error LNK2005: "unsigned int boost::re_detail::re_lock_count" (?re_lock_count@re_detail@boost@@3IA) already defined in libboost_regex-vc71-mt.lib(regex_synch.obj) libboost_regex-vc71-mt-gd-1_32.lib(regex_synch.obj) : error LNK2005: "class boost::re_detail::critical_section * boost::re_detail::p_re_lock" (?p_re_lock@re_detail@boost@@3PAVcritical_section@12@A) already defined in libboost_regex-vc71-mt.lib(regex_synch.obj) test_csfwrapper.obj : error LNK2019: unresolved external symbol "void * __cdecl boost::re_detail::get_mem_block(void)" (?get_mem_block@re_detail@boost@@YAPAXXZ) referenced in function "public: __thiscall boost::re_detail::save_state_init::save_state_init(struct boost::re_detail::saved_state * *,struct boost::re_detail::saved_state * *)" (??0save_state_init@re_detail@boost@@QAE@PAPAUsaved_state@12@0@Z) test_csfwrapper.obj : error LNK2019: unresolved external symbol "void __cdecl boost::re_detail::put_mem_block(void *)" (?put_mem_block@re_detail@boost@@YAXPAX@Z) referenced in function "public: __thiscall boost::re_detail::save_state_init::~save_state_init(void)" (??1save_state_init@re_detail@boost@@QAE@XZ) Debug/csfwrapper.exe : fatal error LNK1120: 2 unresolved externals Programming Tutorial: In Python: To do this, do this In Perl: To do this, do this or this or this or this... In C: To do this, do this, but be careful In C++: To do this, do this, but don't do this, be careful of this, watch out for this, and whatever you do, don't do this __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com

Another frustrating day trying to compile some code...
I'm trying use the regex library. My application is compiled using Multi-threaded Debug DLL (/MDd). I specified the following library libboost_regex-vc71-mt.lib and all I get are link errors.
libboost_regex-vc71-mt.lib is compiled for the release runtime (/MD), so I'm not surprised you got errors. Why not just place the libraries in your compilers search path, and let auto-linking take care of selecting the right one?
My application is a console app so I defined BOOST_REGEX_NO_W32
If you do that, then you also have to compile the library with BOOST_REGEX_NO_W32 defined (put it in boost/regex/user.hpp), however, you can use the default compiled version perfectly well in a console app, so this shouldn't be necessary, unless you really want to avoid linking to user32.lib. John.
participants (2)
-
Alexis H. Rivera-Rios
-
John Maddock