C++ - expected identifier before numeric constant
1. Build log
-------------- Build: Debug in Bubble (compiler: GNU GCC Compiler)---------------
g++ -Wall -std=c++11 -fexceptions -rdynamic -DUSE_OPENCV -g -std=c++11 -I/usr/local/include/opencv4 -Irapidjson/include -Itclap-1.2.2/include -Ilib/sunergy/include -I/usr/local/cuda-10.0/include -Ilib/sunergy/include/track -c /home/strong/codeblocks_workspace/Fire/src/bubble/bubble.cpp -o obj/Debug/src/bubble/bubble.o
In file included from /usr/include/X11/Xlib.h:44:0,
from /home/strong/codeblocks_workspace/Fire/src/bubble/bubble.cpp:18:
lib/sunergy/include/Inference.h:112:2: error: expected identifier before numeric constant
Success,
^
lib/sunergy/include/Inference.h:112:2: error: expected ‘}’ before numeric constant
lib/sunergy/include/Inference.h:112:2: error: expected unqualified-id before numeric constant
In file included from /home/strong/codeblocks_workspace/Fire/src/bubble/config.hpp:3:0,
from /home/strong/codeblocks_workspace/Fire/src/bubble/bubble.cpp:24:
lib/sunergy/include/Inference.h:119:1: error: expected declaration before ‘}’ token
}STATE;
^
Process terminated with status 1 (0 minute(s), 1 second(s))
4 error(s), 0 warning(s) (0 minute(s), 1 second(s))
2. Success 在 X.h
中宏定义和在 Inference.h
中枚举类型定义重复
/usr/include/X11/Xlib.h:44
:
#include <X11/X.h>
/home/strong/codeblocks_workspace/Fire/src/bubble/bubble.cpp:18
:
#include <X11/Xlib.h>
lib/sunergy/include/Inference.h:112
:
typedef enum
{
Success,
BadParam,
ErrorMalloc,
HandleError,
GpuError,
BadImgParam,
NoResult
}STATE;
/usr/include/X11/X.h:350
:
#define Success 0 /* everything's okay */
3. 将个人自定义的名称修改下
Success -> Successful