|
Boost Users : |
From: Carl Wainwright (Carl.Wainwright_at_[hidden])
Date: 2007-05-09 12:37:34
David,
Problem solved :-)
Thanks
Carl
|-----Original Message-----
|From: boost-users-bounces_at_[hidden]
|[mailto:boost-users-bounces_at_[hidden]] On Behalf Of
|David Walthall
|Sent: 09 May 2007 17:21
|To: boost-users_at_[hidden]
|Subject: Re: [Boost-users] Undefined reference
|
|Carl Wainwright wrote:
|> Hi all,
|>
|> I've started just recently to use boost in my C++ application to
|> manage some threads. However, when I link my application I
|get strange
|> undefined references
|>
|> g++ -g -O -o test_exe -lcppunit -ldl -lpthread -lboost_thread Main.o
|> test.o
|> test.o(.text+0x874): In function `threadTestCases::spawnThread()':
|> : undefined reference to
|`boost::thread::thread(boost::function0<void,
|> std::allocator<boost::function_base> > const&)'
|> test.o(.text+0x8b7): In function `threadTestCases::spawnThread()':
|> : undefined reference to `boost::thread::join()'
|> test.o(.text+0x8ce): In function `threadTestCases::spawnThread()':
|> : undefined reference to `boost::thread::~thread()'
|> test.o(.text+0x8eb): In function `threadTestCases::spawnThread()':
|> : undefined reference to `boost::thread::~thread()'
|> collect2: ld returned 1 exit status
|> make: *** [test_exe] Error 1
|>
|> As you can see I have linked in the boost_thread and pthread
|but still
|> I get the problem. My LD_LIBRARY_PATH is correctly setup to
|define the
|> path where boost is installed (/usr/lib/)
|>
|
|Hi Carl,
|
|Try changing the order that you specify the arguments to g++.
|You'll want to put Main.o and test.o before the request to
|link in the libraries.
|
|Here is a link that has some more information (it is about
|DJGPP, but should hold true for your version of g++):
|http://www.delorie.com/djgpp/v2faq/faq8_10.html
|
|
|David
|
|_______________________________________________
|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