首页 > 其他分享 >jsoncpp编译错误

jsoncpp编译错误

时间:2024-03-11 16:36:50浏览次数:11  
标签:__ 错误 missing jsoncpp 编译 token cdefs include before

在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

相关文章

  • 解决问题:HTTP 错误 500.19 - Internal Server Error 无法访问请求的页面,因为该页的相
      缺少AspNetCoreModuleV2模块,下载安装即可。ps:.netframework是可以直接发布,IIS指定就能正常访问的。但aspnetcore项目略有不同,要额外安装一个模块,如果没有安装,会报HTTP错误500.19-InternalServerError的错。1、官方版本地址:https://dotnet.microsoft.com/down......
  • OpenMP - 编译制导(三)
    ordered制导#include<iostream>#include<omp.h>usingnamespacestd;intmain(intargc,char*argv[]){intd[6];#pragmaompparallelfororderedfor(inti=0;i<6;++i){#pragmaompordered{co......
  • OpenMP - 编译制导(二)
    section制导OpenMP中的section子句是用于在sections子句内部将代码划分成几个不同的段。当与#pragmaompparallelsections结合使用时,这些代码段会并行处理。每个section由其中的一个线程执行一次,不同的section可以由不同的线程执行。当然,如果一个线程运行得足够快,它可能会执行......
  • 在 Debian 12.5 上编译安装 Nginx
    1.更新系统软件包并安装必要的构建工具和依赖项:sudoaptupdatesudoaptupgradesudoaptinstallbuild-essentialzlib1g-devlibpcre3-devlibssl-devbash2.下载Nginx源码包:wgethttp://nginx.org/download/nginx-x.y.z.tar.gz#替换x.y.z为你要安装的Nginx版本号tar......
  • 3184:练30.2 错误减法
    3184:练30.2错误减法时间限制:1000ms内存限制:65536KB提交数:2436通过数:1923【题目描述】小明现在正在学习如何将一个数减去1,但是他在处理两位数以上,位数更高的数的时候出现了错误。小明对于一个数做以下的运算:如果一个数的个位不是0,他将这个数减去1......
  • Linux系统安装程序---编译安装
    Linux系统安装程序---编译安装安装nginx安装编译软件*注:编译软件安装需使用网络yum源[root@localhost~]#yuminstall-ygccpcre-developenssl-develzlib-developensslopenssl-devel已加载插件:fastestmirror,langpacksLoadingmirrorspeedsfromcachedhostfile......
  • 用vcpkg 和vs2022,使用msvc编译器,怎么添加新的依赖库(包含头文件与dll)
    安装vcpkg:如果您还没有安装vcpkg,可以通过VisualStudioInstaller安装。在安装或修改VisualStudio时,选择“C++桌面开发”,然后勾选“vcpkg-C++库管理器”1。集成vcpkg到VisualStudio:在VisualStudio中,通过“工具”菜单选择“NuGet包管理器->程序包管......
  • wrf-chem-chem-kpp-kpp2.1-..-gen_kpp.c 文件函数顺序错误(kpp2.1版本),错误文件的路径是
    hereisamistakeinofficialfilegen_kpp.c,theirgen_kpp.c'sfunctiondefinitionorderisreserved!Sowhenyoumakethereisareportoferror:implicitfunction:write_list_to_screen,screen_out,check_all官方很多WRF版本的chem下面的/chem/KPP/util/wkc/gen_......
  • OpenMP - 编译制导(1)
    编译制导是对程序设计语言的扩展。通过对串行程序添加制导语句实现并行化。编译制导语句由下列几部分组成:制导标识符(#pragmaomp)制导名称(parallel,for,section等)子句(private,shared,reduction,copyin等)并行域制导一个并行域就是一个能被多个线程并行执行的程序段。在......
  • Openwrt编译教程
    注意:不要用root用户进行编译国内用户编译前最好准备好梯子默认登陆IP192.168.1.1密码password编译命令:首先装好Linux系统,推荐Debian11或UbuntuLTS安装编译依赖sudoaptupdate-ysudoaptfull-upgrade-ysudoaptinstall-yackantlr3asciidocaut......