参考博客

错误产生

安装json-c库之后,根据GitHub上面的readme文件链接到json-c库时出现以下错误:

SDMBNJson.h:9:23: fatal error: json/json.h: No such file or directory
#include <json/json.h>
^
compilation terminated.

贴出readme:

Linking to `libjson-c`
---------------------- If your system has `pkgconfig`,
then you can just add this to your `makefile`: \```make
CFLAGS += $(shell pkg-config --cflags json-c)
LDFLAGS += $(shell pkg-config --libs json-c)
\ ``` Without `pkgconfig`, you would do something like this: \```make
JSON_C_DIR=/path/to/json_c/install
CFLAGS += -I$(JSON_C_DIR)/include/json-c
LDFLAGS+= -L$(JSON_C_DIR)/lib -ljson-c
\```

可是,按照readme上面的做法还是无法解决问题。

解决方案

在Linux系统中,/usr/include/ 是C/C++等的头文件放置处,当使用源代码方式安装某些数据时,会使用到其中很多文件。因此将编译安装完成的json-c文件夹改名为“json”放在/usr/include/目录下,即可解决:

cd /usr/include
sudo mkdir json
sudo cp /usr/local/include/json-c/* /usr/include/json/

解决Ubuntu16.04 fatal error: json/json.h: No such file or directory的更多相关文章

  1. ubuntu16.04 编译出错:fatal error: SDL/SDL.h: No such file or directory

    在ubuntu 16.04编译神经网络代码时候,遇到了这样一种错误? fatal error: SDL/SDL.h: No such file or directory 原因是SDL库没有安装,根据你 ...

  2. lua.c:82:10: fatal error: readline/readline.h: No such file or directory #include <readline/readline.h>

    make linuxcd src && make linuxmake[1]: Entering directory `/root/lua/lua-5.3.2/src'make all ...

  3. lua.c:80:31: fatal error: readline/readline.h: No such file or directory

    make linuxcd src && make linuxmake[1]: Entering directory `/root/lua/lua-5.3.2/src'make all ...

  4. 【Redis】编译错误zmalloc.h:50:31: fatal error: jemalloc/jemalloc.h: No such file or directory

    [Redis]编译错误zmalloc.h:50:31: fatal error: jemalloc/jemalloc.h: No such file or directory 在安装redis进行编译 ...

  5. fatal error: openssl/bn.h: No such file or directory

    出现如下错误 fatal error: openssl/bn.h: No such file or directory 解决办法 # sudo apt-get install libssl-dev

  6. fatal error: linux/videodev.h: No such file or directory

    Run Build Command:"/usr/bin/make" "cmTC_162a3/fast"/usr/bin/make -f CMakeFiles/c ...

  7. 全志TinaLinux编译错误fatal error: unicode/ucnv.h: No such file or directory

    今天开始正式干活了 拿到一个全志Tina的板子还有一个SDK压缩包,要求我这周(只剩一天半...)就要把sdk编译通过并且把板子跑起来. 还特别跟我说他们试了下这个sdk编译没法通过,会报错... 竟 ...

  8. fatal error: openssl/sha.h: No such file or directory 解决方案

    出现这个或者fatal error: openssl/名单.h: No such file or directory.都是没有安装libssl-dev- libssl-dev包含libraries, ...

  9. 编译内核时出现drivers/mfd/mxc-hdmi-core.c:36:24: fatal error: mach/clock.h: No such file or directory

    在学习恩智浦IMX6D开发板时,编译内核出现 drivers/mfd/mxc-hdmi-core.c::: fatal error: mach/clock.h: No such file or dir ...

  10. msgsrvmgr.cpp:5:37: fatal error: kdl_conversions/kdl_msg.h: No such file or directory #include <kdl_conversions/kdl_msg.h>

    /home/xxx/ros_workspace/src/bp_protocol_bridge/protospot/src/msgsrvmgr.cpp::: fatal error: kdl_conve ...

随机推荐

  1. linux、SMART、Shell的学习

    Linux指令 useradd 添加用户 添加用户 -d 添加用户路径 -e 制定密码有效时间 -G -g 指定用户所属组 -c 指定一段用户描述 -s Shell文件指定用户的登录Shell -u ...

  2. 关于iOS启动页launchImage无法显示解决办法

    在没有美工的时候,往往项目开发到一半,才拿到icon和launchImage图片,这时在添加对应图片之后发现并没有正常显示,这就蛋疼了,以下列出几种解决方式. 关于设置launchImage: 工程配 ...

  3. 使用Hexo + GitHub Pages 搭建个人博客

    一.前言 之前是在CSDN上写博客的,但是无奈其广告满天飞,还有因为个人不太喜欢CSDN博客里的一些东西,加上看到很多技术大牛都有自己的个人博客,于是乎!便想着搭建一个自己的个人博客.其实之前写博客还 ...

  4. 大数据学习--day13(字符串String--源码分析--JVM内存分析)

    字符串String--源码分析--JVM内存分析 String 类的对象 , 是不可变的字符串对象呢 这个不可变很重要,之后要讲的intern()也离不开它的不可变性. https://www.cnb ...

  5. SSM(Spring5.x+Mybatis3)框架搭建【解决日志问题】(Github源码)

    闲来无事,用SSM写个小东西,发现spring已经迭代到5.x了,遂出此文,希望对各位同学有些许帮助. IDE:idea OS:windows 源代码:https://github.com/JHeav ...

  6. 20155310 2016-2017-2《Java程序设计》课堂实践补交

    20155310 2016-2017-2<Java程序设计>课堂实践补交 第九周 程序设计中临时变量的使用 public class linshibianliang { public st ...

  7. 2017-2018-1 20155327 《信息安全系统设计基础》课堂测试&课下作业

    2017-2018-1 20155327 <信息安全系统设计基础>课堂测试&课下作业 学习使用stat(1),并用C语言实现 提交学习stat(1)的截图 man -k ,grep ...

  8. day6 网络 HTML模板

    1.HTML模板 HTML模板 baidu一下 http://www.cssmoban.com/ http://www.cnblogs.com/web-d/archive/2010/04/16/171 ...

  9. 【LG3233】[HNOI2014]世界树

    题面 洛谷 题解 代码 #include <iostream> #include <cstdio> #include <cstdlib> #include < ...

  10. Windows 实例搭建的 FTP 在外网无法连接和访问

    外网无法连接和访问 Windows 实例搭建的 FTP,这种情况可能是由于以下两种原因导致的: 安全组拦截外网访问 防火墙拦截 FTP 进程 安全组拦截外网访问 这种情况下,可以尝试新建一条入方向的安 ...