boostorg / system

Boost.org system module
http://boost.org/libs/system
36 stars 85 forks source link

Minor regression with toolset v141_xp (Visual Studio 2017 - Windows XP) #111

Closed thebrandre closed 1 year ago

thebrandre commented 1 year ago

Before boost version 1.83 and commit 32dbf1b99290ced5666f6b1e8390571c02c94c5e it was possible to compile for Windows XP by setting just the one define define=BOOST_USE_WINAPI_VERSION=0x0501 as an argument for b2.

Now it is also required to add define=_USING_V110_SDK71_. Otherwise you'll get a linker error:

msvcprt.lib(sharedmutex.obj) : error LNK2019: unresolved external symbol imp_ReleaseSRWLockExclusive referenced in function _Smtx_unlock_exclusive msvcprt.lib(sharedmutex.obj) : error LNK2019: unresolved external symbol imp_ReleaseSRWLockShared referenced in function _Smtx_unlock_shared msvcprt.lib(sharedmutex.obj) : error LNK2019: unresolved external symbol imp_AcquireSRWLockExclusive referenced in function _Smtx_lock_exclusive msvcprt.lib(sharedmutex.obj) : error LNK2019: unresolved external symbol imp_AcquireSRWLockShared referenced in function _Smtx_lock_shared msvcprt.lib(sharedmutex.obj) : error LNK2019: unresolved external symbol __imp_TryAcquireSRWLockExclusive referenced in function _Smtx_try_lock_exclusive msvcprt.lib(sharedmutex.obj) : error LNK2019: unresolved external symbol __imp_TryAcquireSRWLockShared referenced in function _Smtx_try_lock_shared

It is not a big deal because we should have been adding this define all along. So there is not actually a need for action here and you can simply close the issue. I just wanted to point it out in case anyone has a similar problem because, unfortunately, this was not quite so easy to trace back.

pdimov commented 1 year ago

A similar problem has been reported in https://github.com/boostorg/system/issues/113 and the fix https://github.com/boostorg/system/commit/a57c5683243ceacc58ee5e3bdc806f189df44dac should make this no longer an issue, even though defining _USING_V110_SDK71_ is still a good idea.