boost::asio and C++0x
Hi, All - I am having some challenges mixing boost and c++0x. My configuration: Ubuntu 10.04, gcc 4.4.3, boost 1.46.1 I've updated the libraries and headers from Ubuntu's stock boost 1.40 level, and I've tried bjam with and without 'toolset=gcc cxxflags=-std=c++0x' Either way, my Eclipse reports several errors in the external libraries: Undefined references to boost::system::generic_category() Undefined references to boost::system::system_category() (both from system and asio error headers) Undefined references to pthread_key_create and pthread_key_delete from asio/detail headers { apologies for not giving specific error details but it'd have to come from a screen shot and that's not appreciated on a mailing list } I do have access to gcc 4.5.1, but it's a custom one for our embedded Atom-based SoC. That is the eventual target, but I haven't seen how to use a specific g++ binary yet. I did see a bug tracker post in one of my google searches but I haven't been able to get back to it. I understand that this is a known issue and a moving target but I would appreciate it if someone would summarize the current state for me. Thanks in advance! -- Don Wilde
I seem to remember that '#define BOOST_SYSTEM_NO_DEPRECATED' fixed the
system-related errors for me under GCC via MinGW-w64 on Windows. Not sure
about the pthread related errors.
Not positive that will work btw, but it's worth a try.
On Fri, Jun 24, 2011 at 4:04 AM, Wilde, Donald S
Hi, All -
I am having some challenges mixing boost and c++0x.
My configuration:
Ubuntu 10.04, gcc 4.4.3, boost 1.46.1
I've updated the libraries and headers from Ubuntu's stock boost 1.40 level, and I've tried bjam with and without 'toolset=gcc cxxflags=-std=c++0x'
Either way, my Eclipse reports several errors in the external libraries:
Undefined references to boost::system::generic_category() Undefined references to boost::system::system_category() (both from system and asio error headers) Undefined references to pthread_key_create and pthread_key_delete from asio/detail headers
{ apologies for not giving specific error details but it'd have to come from a screen shot and that's not appreciated on a mailing list }
I do have access to gcc 4.5.1, but it's a custom one for our embedded Atom-based SoC. That is the eventual target, but I haven't seen how to use a specific g++ binary yet.
I did see a bug tracker post in one of my google searches but I haven't been able to get back to it. I understand that this is a known issue and a moving target but I would appreciate it if someone would summarize the current state for me.
Thanks in advance!
-- Don Wilde
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Ubuntu 10.04, gcc 4.4.3, boost 1.46.1
I've updated the libraries and headers from Ubuntu's stock boost 1.40 level, and I've tried bjam with and without 'toolset=gcc cxxflags=-std=c++0x'
Either way, my Eclipse reports several errors in the external libraries:
Undefined references to boost::system::generic_category() Undefined references to boost::system::system_category() (both from system and asio error headers) Undefined references to pthread_key_create and pthread_key_delete from asio/detail headers
Do you link with Boost.System static lib?
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Igor R Sent: Thursday, June 23, 2011 12:44 PM To: boost-users@lists.boost.org Subject: Re: [Boost-users] boost::asio and C++0x [snip]
Do you link with Boost.System static lib?
Hi, Igor - I hadn't, but I added -lboost_system to my CPP command line. It did not help. Was that the correct way to inject the library? I verified that libboost_system.a is in my /usr/lib directory and it is the 1.46.1 version. Joshua, the NO_DEPRECATED define didn't help either. _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Igor R Sent: Friday, June 24, 2011 5:52 AM To: boost-users@lists.boost.org Subject: Re: [Boost-users] boost::asio and C++0x
I hadn't, but I added -lboost_system to my CPP command line. It did not help. Was that the correct way to inject the library?
Yes, you should link with -lboost_system or -lboost_system-mt for multithreaded version.
Okay, so I did that correctly, thanks for the clarification. It didn't change the errors, though. I will try the mt-version as well, since asio does spin threads. I did see a bug report in your tracker about problems in this situation, but when I googled again I couldn't get back to it. There does appear to be some conflict between c++0x and boost that g++ is not handling.
I hadn't, but I added -lboost_system to my CPP command line. It did not help. Was that the correct way to inject the library?
Yes, you should link with -lboost_system or -lboost_system-mt for multithreaded version.
Okay, so I did that correctly, thanks for the clarification. It didn't change the errors, though. I will try the mt-version as well, since asio does spin threads.
That did not help.
I did see a bug report in your tracker about problems in this situation, but when I googled again I couldn't get back to it. There does appear to be some conflict between c++0x and boost that g++ is not handling.
It appears that gcc up to 4.5.2 did work; the bug was related to bleeding-edge gcc. I am still looking for solutions to this issue. I have successfully built my app with -std=c++0x and boost::thread, but boost::asio gives me errors. TIA! :D
participants (3)
-
Igor R
-
Joshua Boyce
-
Wilde, Donald S