|
Boost Users : |
From: Chris Fairles (chris.fairles_at_[hidden])
Date: 2007-04-30 11:04:15
Testing out boost beta 1.34. I built the whole she-bang with the gcc
toolset. I tried compling my unit tests and they all get:
/usr/lib/gcc/x86_64-redhat-linux/4.1.1/../../../../lib64/crt1.o: In
function `_start':
(.text+0x20): undefined reference to `main'
collect2: ld returned 1 exit status
I don't use the auto test case mechanism. My tests suites look like:
#include "boost/test/unit_test.hpp"
using boost::unit_test::test_suite;
void free_test_function() {
BOOST_CHECK(1 == 1);
}
test_suite*
init_unit_test_suite( int, char* [] ) {
test_suite* test= BOOST_TEST_SUITE( "Unit test example 1" );
test->add( BOOST_TEST_CASE( &free_test_function ) );
return test;
}
I compile using g++ -Wall -I/usr/local/include/boost-1.34 -o
unit_test unit_test_test.cpp -L/usr/local/lib64
-lboost_unit_test_framework-gcc41-mt-d
If i define BOOST_TEST_DYN_LINK either in the cpp file before or after
the unit_test.hpp include, or specifify it using -D on the command
line I get the same results.
I tried to look through the headers responsible for defining
BOOST_TEST_DYN_LINK but theres a lot of references to "msvc
auto-linking" which I of course do not use. Should I be defining
BOOST_ALL_DYN_LINK ? I recall it not being set somewhere because
boost.build v2 doesn't like it or something.
Really i can't make heads or tails of what I should be defining,
whether I shouldve defined something when building the unit test libs,
or whether I should be defining something building my own. The docs
say something about defining BOOST_TEST_DYN_LINK but as stated above,
it doesn't seem to make a difference.
Chris
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net