libfoo_static.lib(foo_static.obj) : error LNK2019: 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::thread_exception::thread_exception(int,char const *)" (??0thread_exception@boost@@QAE@HPBD@Z)
libfoo_static.lib(foo_static.obj) : error LNK2019: 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 'errno_ecat''(void)" (??__Eerrno_ecat@system@boost@@YAXXZ)
libfoo_static.lib(foo_static.obj) : error LNK2019: unresolved external symbol "public: __thiscall boost::thread::thread(void)" (??0thread@boost@@QAE@XZ) referenced in function "int __cdecl foo_static(void)" (?foo_static@@YAHXZ)
libfoo_static.lib(foo_static.obj) : error LNK2019: unresolved external symbol "public: void __thiscall boost::thread::detach(void)" (?detach@thread@boost@@QAEXXZ) referenced in function "public: __thiscall boost::thread::~thread(void)" (??1thread@boost@@QAE@XZ)
bin\msvc-12.0\debug\foo_shared.dll : fatal error LNK1120: 4 unresolved externals
so I have to use:
lib foo_shared : foo_shared.cc foo_static : <link>shared <library>/boost//thread/<link>static : : <library>/boost//thread/<link>static ;
or use <target-os>windows:<library>/boost//thread/<link>static and solve Windows and Linux
in an ugly way. I just don't know the best approach, and I think <cxxflags>-fPIC should be
inherited regardless anything else. With this flags not being inherited, I have other problems
like using <cxxflags>-std=c++11 and Boost.Filesystem generates "undefined reference" under Linux.
What you think? Is there any workaround, maybe force inheritance?
Thank you