[Boost.Test] Link error, need to be pointed in the right direction

Hi, (Apologies if this gets through twice, I think my mail client used the wrong email address the first time) Thanks for taking the time to read through this. First things first: I am using Visual C++ 2005 Express Edition, I have compiled boost version 1.32. I have included the path to the include directory and the lib files directory. Boost is working I have managed to compile and run a number of the other examples (including linking against the libs created during the bjam process (eg boost.threads). The code that has the link error was taken from: http://www.boost.org/libs/test/doc/components/utf/getting_started/index. html --Code-- #include <boost/test/unit_test.hpp> using namespace boost::unit_test; test_suite* init_unit_test_suite( int argc, char* argv[] ) { test_suite* test= BOOST_TEST_SUITE( "const_string test" ); return test; } // EOF --End Code-- The comment at the end of the code suggests that I can compile this code with no errors. Now for the errors: -- Build Log Output -- ------ Build started: Project: Test, Configuration: Debug Win32 ------ Compiling... const_string_test.cpp Linking... const_string_test.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) LIBCMTD.lib(crt0.obj) : error LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup Debug/Test.exe : fatal error LNK1120: 2 unresolved externals Build log was saved at <--SNIPPED LOG PATH--> Test - 3 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== -- End Build Log Output -- I know it is probably something really simple but for the life of me I am just missing it =/. Let me know if you need any more information. Thanks for any advice you can give. Peter.

const_string_test.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)
You need to link with the Unit Test Framework component of Boost.Test Compile it (using bjam or you could use project file supplied with library, VC 2005 will cmvert it to appropriate format automatically) and add to the list of libraries to link with. HTH, Gennadiy
participants (2)
-
Gennadiy Rozental
-
Peter Foley