随笔 - 224  文章 - 0  评论 - 10  阅读 - 35万

jsoncpp编译错误

在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就行了

posted on   弘道者  阅读(120)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· AI与.NET技术实操系列(六):基于图像分类模型对图像进行分类
历史上的今天:
2021-03-11 bash遍历文件夹下面的文件
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示