boost
boost copied to clipboard
Mismatched _WIN32_WINNT version between boost::log and boost::asio on Windows >= 8 environments.
I had to hunt down a link error today, and I am taking some time to report it here.
On a Windows 10 environment, I am building a project with two distinct libraries:
-
Library Alinks againstboost::log -
Library Blinks againstboost::asioandlibrary A
Library B fails to link, with the following linker error:
B.lib: error LNK2038: mismatch detected for 'boost_log_abi': value 'v2s_mt_nt6' doesn't match v alue 'v2s_mt_nt62' in A.lib
As far as I understand, this is because boost::log determines a "default" Windows version of 0x0602 (here) when compiling on Windows >= 8,
whereas boost::asio assumes a default Windows version of 0x0601 (here).
Users can solve this issue by setting an explicit Windows API version, yet it could be preferable if it also linked with default values.