我正在使用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.读完错误后,我明白了我已经定义了
_SILENCE_CXX17_ALLOCATOR_VOID_DEPRECATION_WARNING
或
_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS我在配置属性、->、C/C++、->、通用、->、附加目录中定义了它们一次,但错误仍然存在。
然后,在包含任何头文件之前,我在主文件中定义了booth,宏,但错误仍然存在。
然后,我在预编译的herder中声明了宏,但错误仍然存在。
我甚至尝试了两个不同的增强包。一个安装了vcpkg包管理器,一个预填充二进制文件。
MSVC14.1 x64 Boost : 1.68 (x64)
发布于 2021-01-27 23:11:58
只需关闭"SDL检查“就可以了。详细信息: current project> 'c/c++'>'General'>'SDL checks‘的属性页(VS2019,Win10 X64;2021/01/27)
https://stackoverflow.com/questions/53612757
复制相似问题