在Ubuntu下面编译jsoncpp的代码时候,爆出大量错误,
/usr/include/x86_64-linux-gnu/sys/cdefs.h:41:20: error: missing binary operator before token "(" # if __GNUC_PREREQ (4, 6) && !defined _LIBC ^ /usr/include/x86_64-linux-gnu/sys/cdefs.h:54:44: error: missing binary operator before token "(" # if !defined __cplusplus && __GNUC_PREREQ (3, 3) ^ /usr/include/x86_64-linux-gnu/sys/cdefs.h:60:44: error: missing binary operator before token "(" # if defined __cplusplus && __GNUC_PREREQ (2,8) ^ /usr/include/x86_64-linux-gnu/sys/cdefs.h:121:19: error: missing binary operator before token "(" #if __GNUC_PREREQ (4,3) ^ /usr/include/x86_64-linux-gnu/sys/cdefs.h:140:21: error: missing binary operator before token "(" #elif __GNUC_PREREQ (2,97) ^ /usr/include/x86_64-linux-gnu/sys/cdefs.h:202:19: error: missing binary operator before token "(" #if __GNUC_PREREQ (2,96) ^ /usr/include/x86_64-linux-gnu/sys/cdefs.h:210:19: error: missing binary operator before token "(" #if __GNUC_PREREQ (4, 3) ^ /usr/include/x86_64-linux-gnu/sys/cdefs.h:220:19: error: missing binary operator before token "(" #if __GNUC_PREREQ (2,96) ^ /usr/include/x86_64-linux-gnu/sys/cdefs.h:227:19: error: missing binary operator before token "(" #if __GNUC_PREREQ (2,5) ^ /usr/include/x86_64-linux-gnu/sys/cdefs.h:236:19: error: missing binary operator before token "(" #if __GNUC_PREREQ (3,1) ^ /usr/include/x86_64-linux-gnu/sys/cdefs.h:245:19: error: missing binary operator before token "(" #if __GNUC_PREREQ (3,2) ^ /usr/include/x86_64-linux-gnu/sys/cdefs.h:254:19: error: missing binary operator before token "(" #if __GNUC_PREREQ (4,5) || \ ^ /usr/include/x86_64-linux-gnu/sys/cdefs.h:268:19: error: missing binary operator before token "(" #if __GNUC_PREREQ (2,8) ^ /usr/include/x86_64-linux-gnu/sys/cdefs.h:278:19: error: missing binary operator before token "(" #if __GNUC_PREREQ (2,97) ^ /usr/include/x86_64-linux-gnu/sys/cdefs.h:287:19: error: missing binary operator before token "(" #if __GNUC_PREREQ (3,3) ^ /usr/include/x86_64-linux-gnu/sys/cdefs.h:295:19: error: missing binary operator before token "(" #if __GNUC_PREREQ (3,4) ^ /usr/include/x86_64-linux-gnu/sys/cdefs.h:309:19: error: missing binary operator before token "(" #if __GNUC_PREREQ (3,2) ^ /usr/include/x86_64-linux-gnu/sys/cdefs.h:322:19: error: missing binary operator before token "(" #if __GNUC_PREREQ (4,3) ^ /usr/include/x86_64-linux-gnu/sys/cdefs.h:337:44: error: missing binary operator before token "(" #if (!defined __cplusplus || __GNUC_PREREQ (4,3) \ ^ /usr/include/x86_64-linux-gnu/sys/cdefs.h:356:19: error: missing binary operator before token "(" #if __GNUC_PREREQ (4,3) ^ /usr/include/x86_64-linux-gnu/sys/cdefs.h:365:20: error: missing binary operator before token "(" #if !__GNUC_PREREQ (2,8) ^ /usr/include/x86_64-linux-gnu/sys/cdefs.h:370:20: error: missing binary operator before token "(" #if !__GNUC_PREREQ (2,92) ^ /usr/include/x86_64-linux-gnu/sys/cdefs.h:377:19: error: missing binary operator before token "(" #if __GNUC_PREREQ (3,1) && !defined __GNUG__ ^ /usr/include/x86_64-linux-gnu/sys/cdefs.h:402:25: error: missing binary operator before token "(" && !__GNUC_PREREQ (4,7)) ^ /usr/include/x86_64-linux-gnu/sys/cdefs.h:410:19: error: missing binary operator before token "(" #if __GNUC_PREREQ (8, 0) ^ /usr/include/x86_64-linux-gnu/sys/cdefs.h:421:25: error: missing binary operator before token "(" && (!__GNUC_PREREQ (4, 6) || defined __STRICT_ANSI__))
其实就是因为头文件路径的问题,添加头文件路径的时候 不要包括到json目录内部,例如代码结构是 dir/json/ 那么头文件目录添加dir就行了
标签:__,错误,missing,jsoncpp,编译,token,cdefs,include,before From: https://www.cnblogs.com/yuandaozhe/p/18066431