One of your header files is almost certainly including:
#include <vector>
Before that line, add:
#undef max
And I believe your compiles will start working. This is happening b/c you are also using the C std library, which for some functions uses macros, and in this case, causes the preprocessor to freak out. I've seen this same error on Linux, and undefining that symbol was all i needed to get things compiling again.
本文介绍了如何在C++项目中遇到标准库冲突导致的编译错误时,通过定义特定宏来解决问题。具体案例展示了在使用`<vector>`头文件前,定义`#undef max`宏,可以有效解决与C标准库中的`max`函数冲突的问题,从而使编译顺利进行。
588

被折叠的 条评论
为什么被折叠?



