
Hello all, I'm trying to use the RegEx library and am running into some link issues. My platform is VC++ 7.1. For my project, I have specified all of the Boost static libs so that anything I need should be available: libboost_date_time-vc71-mt-sgd-1_32.lib libboost_filesystem-vc71-mt-sgd-1_32.lib libboost_prg_exec_monitor-vc71-mt-sgd-1_32.lib libboost_program_options-vc71-mt-sgd-1_32.lib libboost_regex-vc71-mt-sgd-1_32.lib libboost_serialization-vc71-mt-sgd-1_32.lib libboost_signals-vc71-mt-sgd-1_32.lib libboost_test_exec_monitor-vc71-mt-sgd-1_32.lib libboost_thread-vc71-mt-sgd-1_32.lib libboost_unit_test_framework-vc71-mt-sgd-1_32.lib libboost_wserialization-vc71-mt-sgd-1_32.lib However, I am seeing the following errors: LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library main.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) main.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/cookbook_tests.exe : fatal error LNK1120: 2 unresolved externals What do I need to do to get my program to successfully link? Thanks, Dave

libboost_regex-vc71-mt-sgd-1_32.lib
That's the debug multithreaded library with a static C runtime, you can only link to that if you are using /MTd
However, I am seeing the following errors:
LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library
main.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)
That function is only used if: 1) You are using STLPort: in that case, you must build Boost.Regex with STLport as well, you may also find that the LNK4098 error only goes away if you use a dll runtime (seems to be an STLport issue, but I'm not sure), you can still static link STLport and Boost.Regex if you are using the dll C runtime BTW. 2) You have defined BOOST_REGEX_NON_RECURSIVE somewhere, in which case you'll also have to rebuild Boost.Regex with it defined (add the define to boost/regex/user.hpp for example). HTH, John.
participants (2)
-
Dave
-
John Maddock