在哪里定义 _SILENCE_CXX17_ALLOCATOR_VOID_DEPRECATION_WARNING 或 _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS 宏?

Dar*_*row 5 c++ boost boost-asio

我正在使用 Boost.Asio 开发 TCP/IP 程序,但出现错误:

note: see declaration of 'std::allocator<void>' 1>d:\hardware\libraries\visual studio 2017\x64\include\boost\asio\use_future.hpp(137): error C4996: 'std::allocator<void>': warning STL4009: std::allocator<void> is deprecated in C++17. You can define
_SILENCE_CXX17_ALLOCATOR_VOID_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning.
Run Code Online (Sandbox Code Playgroud)

阅读错误后,我明白我已经定义了

_SILENCE_CXX17_ALLOCATOR_VOID_DEPRECATION_WARNING

或者

_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS
Run Code Online (Sandbox Code Playgroud)

我在 Configuration Properties -> C/C++ -> General -> Additional #using Directories 中定义了一次,但错误仍然存​​在。

然后我在包含任何头文件之前 #defined 主文件中的宏,但错误仍然存​​在。

然后我在我的每个编译的牧羊人中声明了宏,但错误仍然存​​在。

我什至尝试了 2 种不同的增强包。一个安装了 vcpkg 包管理器和一个预填充二进制文件。

MSVC 14.1 x64 增强:1.68 (x64)

Zim*_*hao 3

只需关闭“SDL 检查”即可。详细信息:当前项目的属性页>'c/c++'>'常规'>'SDL检查'(VS2019,Win10 X64;2021/01/27)