Re: [Boost-users] [Test]: Problem with simple Boost.Test
Date: Mon, 17 Jun 2013 23:03:16 +0000 (UTC)
From: legalize+jeeves@mail.xmission.commailto:legalize+jeeves@mail.xmission.com (Richard)
To: boost-users@lists.boost.orgmailto:boost-users@lists.boost.org
Subject: Re: [Boost-users] [Test]: Problem with simple Boost.Test
Message-ID:
thusly:$ ${CXX} -c --std=c++0x -g -I${TARGET}/include cma.cpp -o cma.o
$ ${CXX} --std=c++0x -g cma.o ${TARGET}/lib/libboost_test_exec_monitor.a \ ${TARGET}/lib/libboost_unit_test_framework.dylib -o cma
Why are you linking against boost_test_exec_monitor? I've never needed to do that. boost_unit_test_framework should be enough.
Interesting. Because I'm finding the following:
I know docs are not ideal but this part is very clear I thought. test_exec_monitor is an old alternative t ounit test framework, which is long deprecated and they definitely do not require each other
$ ${CXX} -c --std=c++0x -g -I${TARGET}/include cma.cpp -o cma.o $ ${CXX} --std=c++0x -g cma.o
${TARGET}/lib/libboost_unit_test_framework.dylib -o cma
Undefined symbols for architecture x86_64: "_main", referenced from: implicit entry/start for main executable ld: symbol(s) not found for architecture x86_64 collect2: error: ld returned 1 exit status $
How do you use Boost.Test? Automated test unit registration? Are you sure you've defined BOOST_TEST_MODULE/BOOST_TEST_MAIN? Gennadiy
[Please do not mail me a copy of your followup] I wrote:
Why are you linking against boost_test_exec_monitor?
I've never needed to do that. boost_unit_test_framework should be enough.
boost-users@lists.boost.org spake the secret code <7364AB234369D348AE1CEBC1A86132DBAD4B95@SVLITMX02.shoretel.com> thusly:
Interesting. Because I'm finding the following:
$ ${CXX} -c --std=c++0x -g -I${TARGET}/include cma.cpp -o cma.o $ ${CXX} --std=c++0x -g cma.o ${TARGET}/lib/libboost_unit_test_framework.dylib -o cma Undefined symbols for architecture x86_64: "_main", referenced from: implicit entry/start for main executable ld: symbol(s) not found for architecture x86_64 collect2: error: ld returned 1 exit status $
There are several ways you can get an appropriate implementation of
main() from Boost.Test.
Since you are using the dynamic library version of Boost.Test, you
need at most one source file that defines BOOST_TEST_MAIN before
including
participants (3)
-
Damien Kick
-
Gennadiy Rozental
-
legalize+jeeves@mail.xmission.com