Subject: [Boost-bugs] [Boost C++ Libraries] #12303: Linker error with boost.locale and operator%
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-06-28 08:01:57
#12303: Linker error with boost.locale and operator%
--------------------------------+------------------------------
Reporter: andreas.kuechler@⦠| Type: Bugs
Status: new | Milestone: To Be Determined
Component: None | Version: Boost 1.61.0
Severity: Problem | Keywords:
--------------------------------+------------------------------
Hi,
I recently updated to boost 1.61 with self-compiled libraries using
MSVC2015 with the following build settings
{{{
.\bootstrap
.\b2 architecture=x86 toolset=msvc -j 12 --layout=tagged
}}}
The libraries are properly compiled but when I link with my application I
get the following errors:
(BOOST_AUTO_LINK_TAGGED is defined globally)
{{{
libboost_locale-mt-gd.lib(date_time.obj) : error LNK2019: unresolved
external symbol "class boost::system::error_category const & __cdecl
boost::system::system_category(void)"
(?system_category_at_system@boost@@YAAEBVerror_category_at_12@XZ) referenced in
function "public: __cdecl
boost::thread_exception::thread_exception(int,char const *)"
(??0thread_exception_at_boost@@QEAA_at_HPEBD@Z)
libboost_locale-mt-gd.lib(generator.obj) : error LNK2001: unresolved
external symbol "class boost::system::error_category const & __cdecl
boost::system::system_category(void)"
(?system_category_at_system@boost@@YAAEBVerror_category_at_12@XZ)
libboost_locale-mt-gd.lib(localization_backend.obj) : error LNK2001:
unresolved external symbol "class boost::system::error_category const &
__cdecl boost::system::system_category(void)"
(?system_category_at_system@boost@@YAAEBVerror_category_at_12@XZ)
libboost_locale-mt-gd.lib(lcid.obj) : error LNK2001: unresolved external
symbol "class boost::system::error_category const & __cdecl
boost::system::system_category(void)"
(?system_category_at_system@boost@@YAAEBVerror_category_at_12@XZ)
libboost_locale-mt-gd.lib(date_time.obj) : error LNK2019: unresolved
external symbol "class boost::system::error_category const & __cdecl
boost::system::generic_category(void)"
(?generic_category_at_system@boost@@YAAEBVerror_category_at_12@XZ) referenced in
function "void __cdecl boost::system::`dynamic initializer for
'errno_ecat''(void)" (??__Eerrno_ecat_at_system@boost@@YAXXZ)
libboost_locale-mt-gd.lib(generator.obj) : error LNK2001: unresolved
external symbol "class boost::system::error_category const & __cdecl
boost::system::generic_category(void)"
(?generic_category_at_system@boost@@YAAEBVerror_category_at_12@XZ)
libboost_locale-mt-gd.lib(localization_backend.obj) : error LNK2001:
unresolved external symbol "class boost::system::error_category const &
__cdecl boost::system::generic_category(void)"
(?generic_category_at_system@boost@@YAAEBVerror_category_at_12@XZ)
libboost_locale-mt-gd.lib(lcid.obj) : error LNK2001: unresolved external
symbol "class boost::system::error_category const & __cdecl
boost::system::generic_category(void)"
(?generic_category_at_system@boost@@YAAEBVerror_category_at_12@XZ)
debug\uniform_initialization.exe : fatal error LNK1120: 2 unresolved
externals
}}}
I got a minimal working example
{{{
#include <boost/locale.hpp>
int main(int argc, char *argv[])
{
(boost::locale::format(boost::locale::translate("Hello, {1}")) %
"World").str();
return 0;
}
}}}
The linker error occurs only if the operator% is used, format and
translate alone compile and link fine.
The linker error disappear as soon as I add {{{#include
<boost/system/error_code.hpp>}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/12303> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:20 UTC