Problem with boost.system

I'm using RCF (C++ IPC framework) and get the following link error on linux: built_components/librcf.a(RCF.o): In function `__static_initialization_and_destruction_0': /home/robi/svn/projects/CacheDaemon/src/ext/boost/boost/system/error_code.hpp:205: undefined reference to `boost::system::get_system_category()' /home/robi/svn/projects/CacheDaemon/src/ext/boost/boost/system/error_code.hpp:206: undefined reference to `boost::system::get_generic_category()' /home/robi/svn/projects/CacheDaemon/src/ext/boost/boost/system/error_code.hpp:211: undefined reference to `boost::system::get_generic_category()' /home/robi/svn/projects/CacheDaemon/src/ext/boost/boost/system/error_code.hpp:212: undefined reference to `boost::system::get_generic_category()' /home/robi/svn/projects/CacheDaemon/src/ext/boost/boost/system/error_code.hpp:213: undefined reference to `boost::system::get_system_category()' built_components/librcf.a(RCF.o): In function `boost::asio::error::get_system_category()': /home/robi/svn/projects/CacheDaemon/src/ext/boost/boost/asio/error.hpp:218: undefined reference to `boost::system::get_system_category()' built_components/librcf.a(RCF.o): In function `error_code': /home/robi/svn/projects/CacheDaemon/src/ext/boost/boost/system/error_code.hpp:312: undefined reference to `boost::system::get_system_category()' built_components/librcf.a(RCF.o): In function `RCF::FilterAdapter::onWriteCompleted(unsigned long, int)': /home/robi/svn/projects/CacheDaemon/src/ext/rcf/src/RCF/AsioServerTransport.cpp:76: undefined reference to `boost::system::get_system_category()' built_components/librcf.a(RCF.o): In function `RCF::FilterAdapter::onReadCompleted(RCF::ByteBuffer const&, int)': /home/robi/svn/projects/CacheDaemon/src/ext/rcf/src/RCF/AsioServerTransport.cpp:65: undefined reference to `boost::system::get_system_category()' collect2: ld returned 1 exit status make[2]: *** [built_components/CacheClient] Error 1 make[1]: *** [CMakeFiles/CacheClient.dir/all] Error 2 make: *** [all] Error 2 And error_code.cpp from boost.system is included AND linked to... besides the whole thing works fine on Windows... :( Ideas? TIA /Rob

Robert Bielik wrote:
I'm using RCF (C++ IPC framework) and get the following link error on linux:
built_components/librcf.a(RCF.o): In function `__static_initialization_and_destruction_0': /home/robi/svn/projects/CacheDaemon/src/ext/boost/boost/system/error_code.hpp:205: undefined reference to `boost::system::get_system_category()' /home/robi/svn/projects/CacheDaemon/src/ext/boost/boost/system/error_code.hpp:206: undefined reference to `boost::system::get_generic_category()' /home/robi/svn/projects/CacheDaemon/src/ext/boost/boost/system/error_code.hpp:211: undefined reference to `boost::system::get_generic_category()' /home/robi/svn/projects/CacheDaemon/src/ext/boost/boost/system/error_code.hpp:212: undefined reference to `boost::system::get_generic_category()' /home/robi/svn/projects/CacheDaemon/src/ext/boost/boost/system/error_code.hpp:213: undefined reference to `boost::system::get_system_category()' built_components/librcf.a(RCF.o): In function `boost::asio::error::get_system_category()': /home/robi/svn/projects/CacheDaemon/src/ext/boost/boost/asio/error.hpp:218: undefined reference to `boost::system::get_system_category()' built_components/librcf.a(RCF.o): In function `error_code': /home/robi/svn/projects/CacheDaemon/src/ext/boost/boost/system/error_code.hpp:312: undefined reference to `boost::system::get_system_category()' built_components/librcf.a(RCF.o): In function `RCF::FilterAdapter::onWriteCompleted(unsigned long, int)': /home/robi/svn/projects/CacheDaemon/src/ext/rcf/src/RCF/AsioServerTransport.cpp:76: undefined reference to `boost::system::get_system_category()' built_components/librcf.a(RCF.o): In function `RCF::FilterAdapter::onReadCompleted(RCF::ByteBuffer const&, int)': /home/robi/svn/projects/CacheDaemon/src/ext/rcf/src/RCF/AsioServerTransport.cpp:65: undefined reference to `boost::system::get_system_category()' collect2: ld returned 1 exit status make[2]: *** [built_components/CacheClient] Error 1 make[1]: *** [CMakeFiles/CacheClient.dir/all] Error 2 make: *** [all] Error 2
And error_code.cpp from boost.system is included AND linked to... besides the whole thing works fine on Windows... :(
I recommend you read this: http://vladimir_prus.blogspot.com/2009/06/linking-101.html In particular, the note about static linking towards the end might be directly relevant. Although you did not say how you "included AND linked to" error_code.cpp, so it's impossible to say for sure. - Volodya

Vladimir Prus skrev:
I recommend you read this:
http://vladimir_prus.blogspot.com/2009/06/linking-101.html
In particular, the note about static linking towards the end might be directly relevant. Although you did not say how you "included AND linked to" error_code.cpp, so it's impossible to say for sure.
Right now I have dependencies on boost::program_options & boost::serialization, how I use boost at the moment is that I build all needed sources into a static library and thus far it works fine. But when adding the boost::system source file, it seems not to anymore... :( The note in the ld docs regarding symbols defined in an archive that are used in later archives (command line wise) seems to fit the bill. I'll try reorder the linking, or use --start-group/--end-group Thnx! /Rob

Robert Bielik skrev:
Vladimir Prus skrev:
I recommend you read this:
http://vladimir_prus.blogspot.com/2009/06/linking-101.html
In particular, the note about static linking towards the end might be directly relevant. Although you did not say how you "included AND linked to" error_code.cpp, so it's impossible to say for sure.
The note in the ld docs regarding symbols defined in an archive that are used in later archives (command line wise) seems to fit the bill. I'll try reorder the linking, or use --start-group/--end-group
Thank you Vladimir, Indeed it was the order of the linking that messed it up. Works fine now... damned ld! /Rob
participants (2)
-
Robert Bielik
-
Vladimir Prus