I decided to update my boost libraries from 1.61 to 1.63, and in the project that I updated to use the new files, I'm getting some new error messages I wasn't getting before:
error LNK2001: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_category@system@boost@@YAAEBVerror_category@12@XZ)
error LNK2001: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::generic_category(void)" (?generic_category@system@boost@@YAAEBVerror_category@12@XZ)
Since my 1.63 libraries are being compiled using Visual Studio 2017, my first assumption is that I've made a mistake compiling the boost libraries, so here are the total steps I'm taking from a clean unzip of the boost files:
- Start Menu→Visual Studio 2017 RC→Developer Command Prompt
- I change directory until I'm in the high-level
boost_1_63_0
folder. - I run
bootstrap.bat
- I open
project-config.jam
for editing - I change
using msvc ;
tousing msvc : 14.1 : E:\Program Files\Microsoft Visual Studio\VC\Tools\MSVC\14.10.24911\bin\HostX64\x64\;
- I open
boost/config/auto_link.hpp
for editing - I make an edit to this file (code listed below after the list)
- In the open command prompt, I execute the command
b2 architecture=x86 address-model=64 link=static threading=multi runtime-link=shared --build-type=complete stage --stagedir=stage/x64 -a
- It completes with the following message at the end (listed below after the list)
- I attempt to use these libraries with my code, using
#define BOOST_LIB_DIAGNOSTIC
to track that the correct files are being used (they are). - I attempt to compile my project that uses boost.asio, and get the two unresolved external symbol errors listed above.
Does anyone know where my mistake is? These errors do not occur if I use the boost 1.61 libraries compiled using Visual Studio 2015 in Visual Studio 2017 RC.
auto_link.hpp (old):
# elif defined (BOOST_MSVC)
// vc14:
# define BOOST_LIB_TOOLSET "vc140"
auto_link.hpp (new):
# elif defined (BOOST_MSVC) && (BOOST_MSVC < 1910)
// vc14:
# define BOOST_LIB_TOOLSET "vc140"
# elif defined (BOOST_MSVC)
// vc15:
# define BOOST_LIB_TOOLSET "vc141"
Message at the end of the boost compilation process:
...failed updating 6 targets...
...skipped 4 targets...
...updated 904 targets...
Libraries shown by use of #define BOOST_LIB_DIAGNOSTIC
:
1>Linking to lib file: libboost_system-vc141-mt-1_63.lib
1>Linking to lib file: libboost_date_time-vc141-mt-1_63.lib
1>Linking to lib file: libboost_regex-vc141-mt-1_63.lib
Let me know if there's any other diagnostic information needed. I tried commenting out various uses of the boost.asio library, but only removing the header entirely eliminated these issues (which, of course, made the boost components unusable).