解决Ubuntu16.04 fatal error: json/json.h: No such file or directory
生活随笔
收集整理的這篇文章主要介紹了
解决Ubuntu16.04 fatal error: json/json.h: No such file or directory
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
參考博客
錯誤產生
安裝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/轉載于:https://www.cnblogs.com/031602523liu/p/9927093.html
總結
以上是生活随笔為你收集整理的解决Ubuntu16.04 fatal error: json/json.h: No such file or directory的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 解决@vue/cli 创建项目是安装ch
- 下一篇: H.264编码profile leve