Boost logo

Boost Users :

From: Gavin Lambert (boost_at_[hidden])
Date: 2019-08-20 00:55:19


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
analysis features.

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.

If you want to file an issue about the differences, the appropriate
place is https://github.com/boostorg/winapi


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net