Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Boost Unit Test through Eclipse and CDT(Problem to built and compile )
Boost Unit Test through Eclipse and CDT [message #1005328] Thu, 24 January 2013 22:00
sam sami is currently offline sam samiFriend
Messages: 1
Registered: January 2013
Junior Member
Recently i update my CDT to use new Unit testing feature. the update process went well. but when i write the simple test program i am not able to build and compile it. My code and Error are as follows. i quite new to C++ and using Eclipse . please help me to resolve the issue.

#include <boost/test/unit_test.hpp>


#define BOOST_TEST_DYN_LINK
#define BOOST_AUTO_TEST_MAIN
#define BOOST_TEST_MODULE First_TestSuite

BOOST_AUTO_TEST_CASE( First_TEst )
{

BOOST_CHECK(2 == 2);


}

Error

12:55:13 ** Incremental Build of configuration Debug for project NewProject ** Info: Internal Builder is used for build g++ "-IC:\boost_1_52_0\boost_1_52_0" -O0 -g3 -Wall -c -fmessage-length=0 -o "src\NewProject.o" "..\src\NewProject.cpp" g++ -o NewProject.exe "src\NewProject.o" src\NewProject.o: In function ZN10First_TEst11test_methodEv': C:\Users\sam\workspace1\NewProject\Debug/../src/NewProject.cpp:19: undefined reference toboost::unit_test::unit_test_log_t::set_checkpoint(boost::unit_test::basic_cstring, unsigned int, boost::unit_test::basic_cstring)' C:\Users\sam\workspace1\NewProject\Debug/../src/NewProject.cpp:19: undefined reference to boost::test_tools::tt_detail::check_impl(boost::test_tools::predicate_result const&, boost::unit_test::lazy_ostream const&, boost::unit_test::basic_cstring<char const>, unsigned int, boost::test_tools::tt_detail::tool_level, boost::test_tools::tt_detail::check_type, unsigned int, ...)' src\NewProject.o: In function_static_initialization_and_destruction_0': C:\Users\sam\workspace1\NewProject\Debug/../src/NewProject.cpp:16: undefined reference to boost::unit_test::ut_detail::auto_test_unit_registrar::auto_test_unit_registrar(boost::unit_test::test_case*, unsigned long)' src\NewProject.o: In functionZN5boost9unit_test15unit_test_log_tC1Ev': C:/boost_1_52_0/boost_1_52_0/boost/test/unit_test_log.hpp:131: undefined reference to vtable for boost::unit_test::unit_test_log_t' src\NewProject.o: In functionZN5boost9unit_test14make_test_caseERKNS0_9callback0INS0_9ut_detail6unusedEEENS0_13basic_cstringIKcEE': C:/boost_1_52_0/boost_1_52_0/boost/test/unit_test_suite_impl.hpp:255: undefined reference to boost::unit_test::ut_detail::normalize_test_case_name(boost::unit_test::basic_cstring<char const>)' C:/boost_1_52_0/boost_1_52_0/boost/test/unit_test_suite_impl.hpp:255: undefined reference toboost::unit_test::test_case::test_case(boost::unit_test::basic_cstring, boost::unit_test::callback0 const&)' src\NewProject.o: In function ZN5boost9unit_test15unit_test_log_tD1Ev': C:/boost_1_52_0/boost_1_52_0/boost/test/unit_test_log.hpp:93: undefined reference tovtable for boost::unit_test::unit_test_log_t' c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../libmingw32.a(main.o):main.c:(.text.startup+0xa7): undefined reference to `WinMain@16' collect2.exe: error: ld returned 1 exit status

12:55:24 Build Finished (took 11s.567ms)
Previous Topic:Build linux with eclipse
Next Topic:[solved]where to set the "m" symbol in the linker
Goto Forum:
  


Current Time: Fri Nov 28 04:47:02 GMT 2014

Powered by FUDForum. Page generated in 0.02045 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software