Boost.Test linker error - undefined reference to 'main'
Hi,
I use the Boost library 1.34.1 on Ubuntu 7.10 (Gusty Gibbon). I get
the following error while linking with libboost_unit_test_framework.
user23@Mycomp:~/scrapbook$ g++ first.cpp -lboost_unit_test_framework
/usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../lib/crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
The first.cpp has the example given in the Boost website
// Boost.Test
#include
Sorry, for the delayed reply.
This looks like an issue uncovered right after 1.34.1 was out. The problem is that you compilation line picks up shared version of Boost.Test library, which doesn't include main anymore for portability reasons. You need to explicely specify that you intend to use static library or rename one of the libraries in your library location.
Gennadiy
"Justin Paul"
participants (2)
-
Gennadiy Rozental
-
Justin Paul