Re: [Dll] Inconsistent annotations reported under visual studio 2019
On 18/08/2019 22:51, Sean Farrow wrote:
> Whilst compiling a plugin in release mode with boost.dll 1.70 using
> Visual Studio 2019 and the latest Windows sdk, I’m getting several
> inconsistent annotation errors for functions like LoadLibraryA/W.
> Before I go to the trouble of creating a reproducible project and filing
> an issue, I wondered whether this is something that is know about and
> possibly fixed in 1.71
It's because Boost uses an incomplete copy of the method prototypes for
various WinAPI functions to avoid pulling a dependency on the platform
SDK. (I'm not entirely sure why, but I assume there was a reason.)
They're sufficiently correct that it won't cause incorrect runtime
behaviour, but can lead to those sorts of warnings since they don't have
the same attributes.
Usually you can ignore that unless you're making use of VS's static
You should be able to resolve it by adding BOOST_USE_WINDOWS_H to the
Preprocessor Definitions of your projects that include Boost, or by
#defining that before including any Boost headers.