BOOST_ASIO_SEPARATE_COMPILATION linker error
HI, I'm trying to build boost 1.47's asio library with the BOOST_ASIO_SEPARATE_COMPILATION macro in windows 7, 32-bit, VS 2010. With this macro, the asio library can be included and built easily without building all of boost or using bjam. However, I get the following linker error: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_category@system@boost@@YAABVerror_category@12@XZ) referenced in function "public: __thiscall boost::system::error_code::error_code(void)" (??0error_code@system@boost@@QAE@XZ) unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::generic_category(void)" (?generic_category@system@boost@@YAABVerror_category@12@XZ) referenced in function "void __cdecl boost::system::`dynamic initializer for 'posix_category''(void)" (??__Eposix_category@system@boost@@YAXXZ) 1> Basically the functions boost::system::system_category and boost::system::generic_category aren't defined anywhere. I can't find the implementation of these functions in boost source when I tried grepping it. Should I just use bjam to build the asio library. Thanks arun
On Wednesday, January 14, 2015 08:22 AM, Arun.Ramasamy@high5games.com wrote:
HI,
I'm trying to build boost 1.47's asio library with the BOOST_ASIO_SEPARATE_COMPILATION macro in windows 7, 32-bit, VS 2010. With this macro, the asio library can be included and built easily without building all of boost or using bjam. However, I get the following linker error:
unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_category@system@boost@@YAABVerror_category@12@XZ) referenced in function "public: __thiscall boost::system::error_code::error_code(void)" (??0error_code@system@boost@@QAE@XZ) unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::generic_category(void)" (?generic_category@system@boost@@YAABVerror_category@12@XZ) referenced in function "void __cdecl boost::system::`dynamic initializer for 'posix_category''(void)" (??__Eposix_category@system@boost@@YAXXZ) 1>
Basically the functions boost::system::system_category and boost::system::generic_category aren't defined anywhere. I can't find the implementation of these functions in boost source when I tried grepping it.
Should I just use bjam to build the asio library.
I don't know about Boost 1.47, but it's currently in boost/system/detail/error_code.ipp You probably need to build and link with boost::system. Ben
On 14 Jan 2015 at 0:22, Arun.Ramasamy@high5games.com wrote:
I'm trying to build boost 1.47's asio library with the BOOST_ASIO_SEPARATE_COMPILATION macro in windows 7, 32-bit, VS 2010. With this macro, the asio library can be included and built easily without building all of boost or using bjam. However, I get the following linker error:
unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_category@system@boost@@YAABVerror_category@12@XZ) referenced in function "public: __thiscall boost::system::error_code::error_code(void)" (??0error_code@system@boost@@QAE@XZ) unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::generic_category(void)" (?generic_category@system@boost@@YAABVerror_category@12@XZ) referenced in function "void __cdecl boost::system::`dynamic initializer for 'posix_category''(void)" (??__Eposix_category@system@boost@@YAXXZ) 1>
Basically the functions boost::system::system_category and boost::system::generic_category aren't defined anywhere. I can't find the implementation of these functions in boost source when I tried grepping it.
If you want an ASIO totally standalone from Boost, use the standalone ASIO distribution available from https://think-async.com/Asio/AsioStandalone which requires C++ 11. Or indeed just pull it from the ASIO git repository. Otherwise yes, standalone ASIO does require Boost to substitute for the C++ 11 STL features it uses, which include system_category and others. You may find using a much newer Boost and if you turn on C++ 11 you may get BOOST_ASIO_SEPARATE_COMPILATION to not require Boost. Niall -- ned Productions Limited Consulting http://www.nedproductions.biz/ http://ie.linkedin.com/in/nialldouglas/
participants (3)
-
Arun.Ramasamy@high5games.com
-
Ben Pope
-
Niall Douglas