Linking problem - boost 1.51
Dear list, I'm starting with boost (Boost.Asio) and I'm following the tutorial available at Boost.Asio web-page. I'm stuck at part 5 (Timer.5) because I'm getting the following linker error: *timer_5.cpp:(.text+0xb3): undefined reference to `boost::thread::~thread()' * *timer_5.cpp:(.text+0xe1): undefined reference to `boost::thread::~thread()' * *collect2: error: ld returned 1 exit status* I'm linking boost_system, boost_thread and pthread (I compiled the boost libraries and at some point I thought that I was including .hpp files from a different version of the libraries but I specified the paths of both .hpp and libraries and the problem remains). The system runs GNU/Linux 64bits (Fedora 17) with GCC 4.7.2 and boost 1.51.0. Any idea? Thanks i advance, -- Daniel
Le 07/10/12 00:29, Daniel Santos a écrit :
Dear list,
I'm starting with boost (Boost.Asio) and I'm following the tutorial available at Boost.Asio web-page. I'm stuck at part 5 (Timer.5) because I'm getting the following linker error:
/timer_5.cpp:(.text+0xb3): undefined reference to `boost::thread::~thread()'/ /timer_5.cpp:(.text+0xe1): undefined reference to `boost::thread::~thread()'/ /collect2: error: ld returned 1 exit status/
I'm linking boost_system, boost_thread and pthread (I compiled the boost libraries and at some point I thought that I was including .hpp files from a different version of the libraries but I specified the paths of both .hpp and libraries and the problem remains). The system runs GNU/Linux 64bits (Fedora 17) with GCC 4.7.2 and boost 1.51.0.
Any idea?
Please, could you post the exact command line giving these errors? Best, Vicente
Hi Vicente,
Here it is:
$ g++ -o timer_5 -L/Data/Temp/Incoming/boost_1_51_0/stage/lib -lpthread
-lboost_system -lboost_thread timer_5.cpp
$ /tmp/ccClVUZf.o: In function `main':
$ timer_5.cpp:(.text+0xb3): undefined reference to
`boost::thread::~thread()'
$ timer_5.cpp:(.text+0xe1): undefined reference to
`boost::thread::~thread()'
$ collect2: error: ld returned 1 exit status
--
Daniel
On 7 October 2012 16:55, Vicente J. Botet Escriba
Le 07/10/12 00:29, Daniel Santos a écrit :
Dear list,
I'm starting with boost (Boost.Asio) and I'm following the tutorial available at Boost.Asio web-page. I'm stuck at part 5 (Timer.5) because I'm getting the following linker error:
*timer_5.cpp:(.text+0xb3): undefined reference to `boost::thread::~thread()'* *timer_5.cpp:(.text+0xe1): undefined reference to `boost::thread::~thread()'* *collect2: error: ld returned 1 exit status*
I'm linking boost_system, boost_thread and pthread (I compiled the boost libraries and at some point I thought that I was including .hpp files from a different version of the libraries but I specified the paths of both .hpp and libraries and the problem remains). The system runs GNU/Linux 64bits (Fedora 17) with GCC 4.7.2 and boost 1.51.0.
Any idea?
Please, could you post the exact command line giving these errors?
Best, Vicente
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Le 07/10/12 17:17, Daniel Santos a écrit :
Hi Vicente,
Here it is: $ g++ -o timer_5 -L/Data/Temp/Incoming/boost_1_51_0/stage/lib -lpthread -lboost_system -lboost_thread timer_5.cpp $ /tmp/ccClVUZf.o: In function `main': $ timer_5.cpp:(.text+0xb3): undefined reference to `boost::thread::~thread()' $ timer_5.cpp:(.text+0xe1): undefined reference to `boost::thread::~thread()' $ collect2: error: ld returned 1 exit status
I don't see any -I
Finaly I solved it. It was a STUPID mistake. I defined the BOOST_ROOT
(.bashrc) and I thought it was enough. I was wrong and gcc was "using" the
headers from boost 1.48 and trying to link with the libs I've compiled,
boost 1.51. I just added *-I/Data/Temp/Incoming/boost_1_51_0 *and it works.
My original idea was using same headers with different possible libraries
(Debug/Release)...
Sorry for taking your time with a stupid "problem" like that one. Anyway,
thank you for your time and help.
*
*
Regards,
*--*
*Daniel *
On 7 October 2012 19:26, Vicente J. Botet Escriba
Le 07/10/12 17:17, Daniel Santos a écrit :
Hi Vicente,
Here it is: $ g++ -o timer_5 -L/Data/Temp/Incoming/boost_1_**51_0/stage/lib -lpthread -lboost_system -lboost_thread timer_5.cpp $ /tmp/ccClVUZf.o: In function `main': $ timer_5.cpp:(.text+0xb3): undefined reference to `boost::thread::~thread()' $ timer_5.cpp:(.text+0xe1): undefined reference to `boost::thread::~thread()' $ collect2: error: ld returned 1 exit status
I don't see any -I
. From where are you getting the Boost header files? Could you post the example?
best, Vicente ______________________________**_________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/**mailman/listinfo.cgi/boost-**usershttp://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
Daniel Santos
-
Vicente J. Botet Escriba