在编译jsoncpp示例代码时需要一些帮助 [英] need some help in compiling a jsoncpp sample code

查看:96
本文介绍了在编译jsoncpp示例代码时需要一些帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试编译一个示例jsoncpp示例,但是在标准"标头中显示了大量编译错误.有没有人在任何时候看到这个?

I am trying to compile a sample jsoncpp example, but there are tons of compiling errors showing up in "standard" headers. did any body see this any time ?

[~]$ g++ -g -c json.cc -I/usr/local/include/json 
In file included from /usr/include/libio.h:62,
                 from /usr/include/stdio.h:75,
                 from /usr/lib/gcc/i686-redhat-linux/4.4.6/../../../../include/c++/4.4.6/cstdio:45,
                 from json.cc:1:
/usr/include/sys/cdefs.h:46:44: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:50:44: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:135:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:151:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:209:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:218:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:227:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:236:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:248:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:258:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:267:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:275:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:289:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:297:43: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:326:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:338:20: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:343:20: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:350:19: error: missing binary operator before token "("
In file included from /usr/lib/gcc/i686-redhat-linux/4.4.6/../../../../include/c++/4.4.6/cstring:45,
                 from json.cc:2:

推荐答案

对我来说,这是json-cpp附带的features.h与其他一些系统特性冲突的系统.我在json-cpp代码中将其本地重命名为json_features.h,一切都很好.

For me it was the features.h included with json-cpp conflicting with the system features.h in some other includes. I renamed it locally to json_features.h in the json-cpp code and all was well.

这篇关于在编译jsoncpp示例代码时需要一些帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆