Test Tools Linking Problem

I am an experienced programmer, but new to the Boost Libraries. I am using Boost 1.32.0 with MinGW under XP Pro. I have successfully compiled and link a program to the boost_regex-mgw-mt-1_32.dll Now I am trying use Boost test tools to write tests for it. When I compile and link, the compile passes without warnings, but the link fails with undefined reference to 'boost::test_tools::tt_detail::message_impl( boost::basic_wrap_stringstream<char>&, boost::unit_test::basic_cstring<char const>, unsigned int)' I initially set up to statically link with libboost_unit_test_framework-mgw-mt-1_32.lib. When I got the undefined reference, I added libboost_test_exec_monitor-mgw-mt-1_32.lib and libboost_prg_exec_monitor-mgw-mt-1_32.lib, "just in case." Still undefined. Eventually, I tried added in almost all of the static libraries PLUS copies all of the DLL into the program directory. Still undefined. At that point, I figured that something more than an incomplete makefile is the problem here. Anyone have any idea what I've missing? Merrill

Sorry It took me awhile to answer.
When I compile and link, the compile passes without warnings, but the link fails with
undefined reference to 'boost::test_tools::tt_detail::message_impl( boost::basic_wrap_stringstream<char>&, boost::unit_test::basic_cstring<char const>, unsigned int)'
This function is implemented in test_tools.cpp. I really don't see a way for it to be unresolved.
I initially set up to statically link with libboost_unit_test_framework-mgw-mt-1_32.lib. When I got the undefined reference, I added libboost_test_exec_monitor-mgw-mt-1_32.lib and libboost_prg_exec_monitor-mgw-mt-1_32.lib, "just in case." Still undefined.
You shouldn't need more then one Boost.Test component.
Eventually, I tried added in almost all of the static libraries PLUS copies all of the DLL into the program directory. Still undefined. At that point, I figured that something more than an incomplete makefile is the problem here.
Try to rebuild libboost_unit_test_framework-mgw-mt-1_32.lib. Make sure you are using the same options when you are compiling library and your test. Try to add Boost.Test sources directly into your makefile.
Anyone have any idea what I've missing?
Should be something trivial. Let me know it you still have problems.
Merrill
Gennadiy
participants (2)
-
Gennadiy Rozental
-
Merrill Cornish