参考博客

错误产生

安装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. php的mysqli_connect函数显示 No such file or directory错误以及localhost换成127.0.0.1执行成功

    Centos7环境-php7-MariaDB5.5.60 (新安装的php7,执行php -m 显示有mysqli模块,php.ini没有改其它) 测试代码为: <?php //~ echo d ...

  2. Mysql存中文字符出错:Incorrect string value: '\xC2\xE9\xD7\xED\解决方法

    1.数据库连接设置编码格式为UTF-8 jdbc:mysql://localhost:3306/jbpm_test?useUnicode=true&characterEncoding=UTF- ...

  3. 【Memcached】原理、体系架构、基本操作及路由算法

    1. 什么是Memcached 要了解Memcached首先要到官网上去看官方对它的描述.Memcached的官网网站是:http://memcached.org/,官方对Memcached的描述如下 ...

  4. Role Helper

    using System; using Microsoft.Xrm.Sdk; using Microsoft.Crm.Sdk.Messages; using System.Collections.Ge ...

  5. HBase操作一

    package Hbase; import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.a ...

  6. Swift里performSelector方法的替代

    最近在回答StackOverflow的问题时,发现performSelector方法在Swift被去掉,Apple的注释是这个方法被去掉是因为不安全: NOTE The performSelector ...

  7. ConfigurationManager 读写AppSettings键值对

    using System; using System.Configuration; namespace ConsoleApplication1 { class Program { static voi ...

  8. 【转载】漫谈C++:良好的编程习惯与编程要点

    原文: 漫谈C++:良好的编程习惯与编程要点 阅读目录 以良好的方式编写C++ class Class with pointer member(s):记得写Big Three static与类 正文 ...

  9. 让div跟着鼠标移动

    朋友求助帖 具体实现代码 <!DOCTYPE html> <html lang="en"> <head> <meta charset=&q ...

  10. 18、Java线程面试题 Top 50

    Java线程面试题 Top 50 原文链接:http://www.importnew.com/12773.html   本文由 ImportNew - 李 广 翻译自 javarevisited.欢迎 ...