Newbie Issues linking Boost Unit Test Framework
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
hey there...
I recently downloaded, built, and installed Boost 1.32.
I am attempting to use the Boost Unit Test Framework but am running
into difficulties figuring out which lib to link to.
I am compiling with MS VC++ 7.1. The headers appear to be discovered
as they should be, but the linker is failing
to find the correct lib. I have tried many of the libs which were
created by the build, but these all create more errors
(typically to do with redefinitions of std:: functions). At this
point I am only trying to compile the example code
supplied on the projects web site.
some of the libs I tried:
libboost_prg_exec_monitor-vc71-mt-1_32.lib
libboost_test_exec_monitor-vc71-mt-1_32.lib
libboost_unit_test_framework-vc71-mt-1_32.lib
some articles I found online advised turning on mutithreading in the
compiler properities, enabling run time type identification, and
setting exceptions to /EHa
I've done all of this but nothing is working, it really just looks
like a linker problem.
Thanks for any help
Dave
- -------------------------
linking errors:
Linking...
main.obj : error LNK2019: unresolved external symbol "bool __cdecl
boost::test_tools::tt_detail::test_and_continue_impl(bool,class
boost::basic_wrap_stringstream<char> &,class
boost::unit_test::basic_cstring<char const >,unsigned int,bool,enum
boost::unit_test::log_level)"
(?test_and_continue_impl@tt_detail@test_tools@boost@@YA_N_NAAV?$basic_
wrap_stringstream@D@3@V?$basic_cstring@$$CBD@unit_test@3@I0W4log_level
@63@@Z) referenced in function "void __cdecl
free_test_function(void)" (?free_test_function@@YAXXZ)
main.obj : error LNK2019: unresolved external symbol "public: void
__thiscall boost::unit_test::test_suite::add(class
boost::unit_test::test_case *,unsigned long,int)"
(?add@test_suite@unit_test@boost@@QAEXPAVtest_case@23@KH@Z)
referenced in function "class boost::unit_test::test_suite * __cdecl
init_unit_test_suite(int,char * * const)"
(?init_unit_test_suite@@YAPAVtest_suite@unit_test@boost@@HQAPAD@Z)
main.obj : error LNK2019: unresolved external symbol "public:
__thiscall boost::unit_test::test_suite::test_suite(class
boost::unit_test::basic_cstring<char const >)"
(??0test_suite@unit_test@boost@@QAE@V?$basic_cstring@$$CBD@12@@Z)
referenced in function "class boost::unit_test::test_suite * __cdecl
init_unit_test_suite(int,char * * const)"
(?init_unit_test_suite@@YAPAVtest_suite@unit_test@boost@@HQAPAD@Z)
main.obj : error LNK2019: unresolved external symbol "class
std::basic_string
"Malloc"
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
hey there...
I recently downloaded, built, and installed Boost 1.32.
I am attempting to use the Boost Unit Test Framework but am running into difficulties figuring out which lib to link to.
I am compiling with MS VC++ 7.1. The headers appear to be discovered as they should be, but the linker is failing to find the correct lib. I have tried many of the libs which were created by the build, but these all create more errors (typically to do with redefinitions of std:: functions). At this point I am only trying to compile the example code supplied on the projects web site.
Which example?
some of the libs I tried:
libboost_prg_exec_monitor-vc71-mt-1_32.lib libboost_test_exec_monitor-vc71-mt-1_32.lib libboost_unit_test_framework-vc71-mt-1_32.lib
You need only one of the above depending on with component you are using.
some articles I found online advised turning on mutithreading in the compiler properities, enabling run time type identification, and setting exceptions to /EHa
This seems like right direction to look.
I've done all of this but nothing is working, it really just looks like a linker problem.
There isn't much I could help here. It's obviosly some kind of flags mismatch between library and test compilation. What I would recommend to do is add MS VC library project into your solution (they are located in build directory). Compile and use library produced by it. And compare fllags.
Thanks for any help Dave
Gennadiy
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
"Gennadiy Rozental"
"Malloc"
wrote in message news:cqn2p1$vda$1@sea.gmane.org...
Hi there... I switched the lib to: libboost_unit_test_framework-vc71-mt.lib and added BOOST_TEST_NO_AUTO_LINK to the preprocessor configuration and this seems to work. The code now runs through to the end but it reports a memory access violation in one of the *.cpp used to build the lib ?? The memory error shows up even if I change the test case to test "2 == 2" so I am confused as to whether or not the code is actually behaving as expected. The code I was trying to compile is the first test example (unit_test_example1). thanks for the help Dave - --- run results - ------------------------------------------------------ Running 1 test case... e:/c++source/unittests/main.cpp(17): error in "free_test_function": test 2 == 1 failed Exception in "free_test_function": memory access violation E:/downloads/boost/boost_1_32_0/libs/test/build/../src/unit_test_suite .cpp(150): fatal error in "free_test_function": Testing aborted *** 1 failure detected (1 failure expected) in test suite "Unit test example 1" Press any key to continue -----BEGIN PGP SIGNATURE----- Version: PGPfreeware 6.5.3 for non-commercial use http://www.pgp.com iQA/AwUBQc/vRE6myMoV5dC/EQKStQCgzabC7Q7ZbVgU1vzug1sfGf03D/wAoJ9z M8tJaogFuqHXgPhCA8+DnQKW =LExm -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
"Gennadiy Rozental"
"Malloc"
wrote in message news:cqn2p1$vda$1@sea.gmane.org...
I realized what I was reading after that last post. It appears that the library is functioning fine now. no more coding at 5am... promise :) Thanks for all the help Dave -----BEGIN PGP SIGNATURE----- Version: PGPfreeware 6.5.3 for non-commercial use http://www.pgp.com iQA/AwUBQc/xH06myMoV5dC/EQKh3gCguYa5Mjt2jMwn7tacx9RT4L+GqcMAn2+x mM0oth5POlCjtFwU9VgsjygW =PFV1 -----END PGP SIGNATURE-----
participants (2)
-
Gennadiy Rozental
-
Malloc