Boost logo

Boost Users :

From: Michael Peterson (mtp1032_at_[hidden])
Date: 2004-11-27 14:36:12


Thanks, Gennadiy and Robert. I may not have provided enough information
in my original posting. So, I've attached the code that won't link,
i.e., yields the unresolved reference to test main. You'll see that I'm
using init_unit_test_suite(). I might add that using test_main() gives
rise to the same problem.

By the way, this compiles and runs just fine on Windows XP. Sigh...

Hope you can help,

Cheers,

Michael

-----Original Message-----
From: boost-users-bounces_at_[hidden]
[mailto:boost-users-bounces_at_[hidden]] On Behalf Of Gennadiy
Rozental
Sent: Saturday, November 27, 2004 10:38 AM
To: boost-users_at_[hidden]
Subject: [Boost-users] Re: [Q] Unresolved references when linking
againstthetest libs

MessageHi, Michael

Looks like you are trying to use Test Execution Monitor. For
documentation check
http://www.boost.org/libs/test/doc/components/test_exec_monitor/index.ht
ml

Specifically look on Usage section, tht answer your question in details.

Regards,

Gennadiy

> "Michael Peterson" <mtp1032_at_[hidden]> wrote in message
news:000001c4d401$f2dad520$1d02a8c0_at_wxp2000...
> I apologize in advance if this turns out to be a linker problem not
related to boost. So here goes:
>
> For compatibility/legacy reasons, we can not use the Boost.Build
> jamfiles
to build our application. Accordingly, I've written a set of traditional
makefiles to build
> the project's executables and have run into difficulties.
>
> Specifically, when I try to link my test program against the boost
> test
libraries, I get an error message (reformatted for easy reading) saying
that the reference to
> test_main can not be resolved. Here's the spew (formatted to make it
easier to read):
>
g++ -g3 -L../long/debug -L/usr/lib -L/usr/local/lib
g++ -L/usr/local/lib/stlpor
t -L/usr/local/lib/boost
> -o "debug/unit_test" debug/longtest.o
> -lLong
> -lboost_unit_test_framework-gcc-mt-p

If you are using Test Execution Monitor you dont need to link with above
library, only with one below.

> -lboost_test_exec_monitor-gcc-mt-p
> -lpthread -lc
>
> /usr/local/lib/boost/libboost_test_exec_monitor-gcc-mt-p.so: undefined
reference to `test_main(int, char**)' collect2: ld returned 1 exit
> status make: *** [debug/unit_test] Error 1
> According to nm, the undefined reference, test_main, is defined in the
exec_monitor library. I've tried reordering the libraries but no joy.
Any advice and/or hints
> would be very much appreciated.
>
> I am using STLPort-4.6.2 and boost_1_32_0 and Linux (I386)
>
> Cheers,
>
> Michael

_______________________________________________
Boost-users mailing list
Boost-users_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/boost-users




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