From: Benoit Sigoure (tsuna_at_[hidden])
Date: 2008-01-14 05:06:46
On Jan 14, 2008, at 9:31 AM, Jens Seidel wrote:
> $ g++ -DBOOST_TEST_DYN_LINK test.cpp -lboost_unit_test_framework
> /tmp/ccKcB2Ps.o: In function `main':
> test.cpp:(.text+0x3d4): undefined reference to
> `boost::unit_test::unit_test_main(bool (*)(), int, char**)'
> libboost_unit_test_framework.a(framework.o): In function
> `boost::unit_test::framework::init(int, char**)':
> (.text+0x6fa): undefined reference to `init_unit_test_suite(int,
> collect2: ld returned 1 exit status
I /worked around/ this issue by always defining a dummy
init_unit_test_suite symbol (which was an idea and a contribution of
Hubert Figuiere). This seems totally wrong to me but "It Gets The
Job Done". I'm just sad that I have to write such kludge to satisfy
the weird need of a library. Most of the lib I know which need to
interact directly with `main' require you to invoke a function
directly from within main. Qt is a great example, you must
instantiate a QApplication and give it argc and argv. It's a very
common idiom. Yet Boost.Test decided that it was a good idea to
embed a `main' in a library (!). What if I want to link with two
libraries that decided that it was their own right to define `main'?
Come on, this is almost ridiculous and it seems that Gennadiy is not
willing to make any effort to understand the problem.
Gennadiy, don't take this remark as an attack against you, I have
nothing against you, it's just that you don't seem to be inclined to
understand the issue.
-- Benoit Sigoure aka Tsuna EPITA Research and Development Laboratory
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk