赞
踩
在linux下面使用Jsoncpp,在编译时添加了头文件搜索路径-Ixxxx/json ,导致很多错误,如下:
In file included from /usr/include/x86_64-linux-gnu/c++/5/bits/c++config.h:482:0,
from /usr/include/c++/5/iostream:38,
from JsonProcess.cpp:1:
/usr/include/x86_64-linux-gnu/c++/5/bits/os_defines.h:44:19: error: missing binary operator before token “(”
#if __GLIBC_PREREQ(2,15) && defined(_GNU_SOURCE)
.....
.....
In file included from /usr/include/libio.h:56:0,
from /usr/include/stdio.h:74,
from JsonProcess.cpp:2:
/usr/include/x86_64-linux-gnu/sys/cdefs.h:41:20: error: missing binary operator before token “(”
....
/usr/include/c++/5/cwchar:208:11: error: ‘::wmemchr’ has not been declared
using ::wmemchr;
....
解决方式如下:
编译时json库的头文件搜索路径必须选择json.h的上一级目录,不能使头文件所在目录,在引用json.h的地方加上"json/json.h"
————————————————
版权声明:本文为CSDN博主「兵的N维空间」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/yubing841026/article/details/76914662
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。