[filesystem][1.35] dependency on boost::system

Guys, we've got an issue while upgrading to release 1.35 of boost libraries. Since boost::filesystem now depends on boost::system, following list of linker errors appears ONLY on windows platform (VC9 compiler is used): source.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class boost::system::error_category const & __cdecl boost::system::get_system_category(void)" (__imp_?get_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) source.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class boost::system::error_category const & __cdecl boost::system::get_posix_category(void)" (__imp_?get_posix_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) ..\bin\bsys\msvc-8.0\debug\threading-multi\use_boost_filesystem.dll : fatal error LNK1120: 2 unresolved externals In attach there is a minimal project (source.cpp + Jamfile) that reproduces the problem and a patch that fixes the problem. Thanks, waiting for your feedback Sasha

Alexander Arhipenko wrote:
Guys, we've got an issue while upgrading to release 1.35 of boost libraries. Since boost::filesystem now depends on boost::system, following list of linker errors appears ONLY on windows platform (VC9 compiler is used):
source.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class boost::system::error_category const & __cdecl boost::system::get_system_category(void)" (__imp_?get_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) source.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class boost::system::error_category const & __cdecl boost::system::get_posix_category(void)" (__imp_?get_posix_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) ..\bin\bsys\msvc-8.0\debug\threading-multi\use_boost_filesystem.dll : fatal error LNK1120: 2 unresolved externals
In attach there is a minimal project (source.cpp + Jamfile) that reproduces the problem and a patch that fixes the problem.
Thanks, waiting for your feedback
Why are you adding <library>/boost/system only for shared link. It seems to be it should be added to build requirements unconditionally. - Volodya

On Mon, Apr 7, 2008 at 6:49 PM, Vladimir Prus <ghost@cs.msu.su> wrote:
Alexander Arhipenko wrote:
Guys, we've got an issue while upgrading to release 1.35 of boost libraries. Since boost::filesystem now depends on boost::system, following list of linker errors appears ONLY on windows platform (VC9 compiler is used):
source.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class boost::system::error_category const & __cdecl boost::system::get_system_category(void)" (__imp_?get_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) source.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class boost::system::error_category const & __cdecl boost::system::get_posix_category(void)" (__imp_?get_posix_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) ..\bin\bsys\msvc-8.0\debug\threading-multi\use_boost_filesystem.dll : fatal error LNK1120: 2 unresolved externals
In attach there is a minimal project (source.cpp + Jamfile) that reproduces the problem and a patch that fixes the problem.
Thanks, waiting for your feedback
Why are you adding <library>/boost/system only for shared link. It seems to be it should be added to build requirements unconditionally.
- Volodya
Hi, Volodya! This behavior only occurs on MS platform when linking to boost.filesystem built as shared library (I need to have a deeper look at the library to find out why). That's why I hadn't added dependency when linking boost.filesystem statically. But using unconditional build requirements also works fine. Maybe it's better to ask library author to propose right solution. Regards, Sasha
participants (2)
-
Alexander Arhipenko
-
Vladimir Prus