tun*_*2fs 1 c++ visual-studio visual-c++
我有以下代码在Linux和Mac OS X下编译没有错误.我现在想用Windows编译代码,但是我在以下代码段中遇到了很多错误:
...
enum Type
{
UPDATE = 0, DELETE = 1
};
...
Run Code Online (Sandbox Code Playgroud)
错误消息是这些:
1>Request.hpp(48) : error C2143: syntax error : missing '}' before '('
1>Request.hpp(48) : error C2059: syntax error : '<L_TYPE_raw>'
1>Request.hpp(49) : error C2143: syntax error : missing ';' before '}'
1>Request.hpp(49) : error C2238: unexpected token(s) preceding ';'
Run Code Online (Sandbox Code Playgroud)
我错了什么,我真的很困惑,因为这在Linux下编译没有错误.什么可能导致这个错误?
解决方案非常简单,但需要找出DELETE是在windows标头中定义的宏.
我现在添加了#undef DELETE,它运行正常.