1 error C2589: “(”: “::”右边的非法标记 error C2059: 语法错误 : “::
摘自:https://www.cnblogs.com/polly333/p/5148537.html
size.Width = (std::max)(size.Width, elementSize.Width);
函数模板max与Visual C++中的全局的宏max冲突
2编译提示:error C4996 : 'GetVersionExW' : 被声明为已否决
解决办法:
1、项目 >> 属性 >> C / C++ >> 常规 >> sdl检查,选择“否”
2、项目 >> 属性 C++ >> 预处理 中加入 _CRT_SECURE_NO_WARNINGS
3、#pragmawarning(disable: 4996)
类似的提示错误:
错误 C4996 'vsprintf': This function or variable may be unsafe. Consider using vsprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
3See documentation on how to use Visual C++ 'Checked Iterators'
解决办法:
右键项目-->属性--> 【通用配置】/【c/c++】/ 【预处理器】中第一行 【预处理器定义】中右边点击编译 ,在最下方加入_SCL_SECURE_NO_WARNINGS 确定即可;
注意: 添加的是_SCL_SECURE_NO_WARNINGS 去掉提示错误-D_SCL_SECURE_NO_WARNINGS前面的-D ;
error C4996: 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::copy':
Function call with parameters that may be unsafe - this call relies on the caller to check
that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS.
See documentation on how to use Visual C++ 'Checked Iterators'