在编译项目时,发生了如下错误:
In file included from trunk/be/include/nodes/JoinedTable.h:11:0,
from trunk/be/include/nodes/SelectStmt.h:34,
from trunk/be/include/nodes/SubPlan.h:19,
from trunk/be/include/queryexecutor/iqueryexecutor.h:20,
from trunk/be/include/coord/RootCoordinator.h:14,
from trunk/be/include/sessionservice/query_exec_engine.h:9,
from trunk/be/include/sessionservice/gmcommond_engine.h:28,
from trunk/be/include/gmcommand/IGMCommandService.h:27,
from trunk/be/include/storagelimit/StorageLimitCmdService.h:31,
from trunk/be/src/storagelimit/StorageLimitCmdService.cpp:23:
trunk/be/include/nodes/filter.h:34:7: error: expected identifier before ‘,’ token
IN,
^
In file included from trunk/be/include/nodes/JoinedTable.h:11:0,
from trunk/be/include/nodes/SelectStmt.h:34,
from trunk/be/include/nodes/SubPlan.h:19,
from trunk/be/include/queryexecutor/iqueryexecutor.h:20,
from trunk/be/include/coord/RootCoordinator.h:14,
from trunk/be/include/sessionservice/query_exec_engine.h:9,
from trunk/be/include/sessionservice/gmcommond_engine.h:28,
from trunk/be/include/gmcommand/IGMCommandService.h:27,
from trunk/be/include/storagelimit/StorageLimitCmdService.h:31,
from trunk/be/src/storagelimit/StorageLimitServiceBlock.cpp:10:
trunk/be/include/nodes/filter.h:34:7: error: expected identifier before ‘,’ token
IN,
^
经过检查文件,提示错误处仅仅是个枚举:
enum OP {
GT,
GE,
LT,
LE,
EQ,
IN,
NE,
OP_NL
};
网上搜索从这个博客得知,有可能是因为在包含此文件的源文件中已经IN这个定义了。于是使用
#ifdef IN
#undef IN
#endif
来解除IN的宏,之后编译通过。
查找哪个地方存定义了IN,这里费了很多周折,最后是将IN写到源文件中:然后通过IDE的查找定义功能查找到,在Common-def.h和DataStreamReader.h中有如下定义:
//DataStreamReader.h
#define IN
#define OUT
//Common-def.h
#define IN
#define OUT