boost icon indicating copy to clipboard operation
boost copied to clipboard

Mismatched _WIN32_WINNT version between boost::log and boost::asio on Windows >= 8 environments.

Open Adnn opened this issue 3 years ago • 0 comments

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 A links against boost::log
  • Library B links against boost::asio and library 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.

Adnn avatar Jan 09 '23 11:01 Adnn