1. 安装依赖

sudo apt-get install git gcc clang libtool autoconf automake doxygen valgrind

一些版本要求,如果版本过低可以从github上使用源码安装。

  1. libtool≥2.2.6b
  2. autoconf≥2.64
  3. automake≥1.13
  4. doxygen≥1.8.13

2. 安装

git clone https://github.com/json-c/json-c.git
cd json-c
sh autogen.sh
./configure
make
sudo make install
  • 测试:
make check

Ubuntu16.04安装json-c

注意

为了在make编译的过程中使用json-c,需要修改makefile的信息:

  • 已经安装pkgconfig
CFLAGS += $(shell pkg-config --cflags json-c)
LDFLAGS += $(shell pkg-config --libs json-c)
  • 未安装pkgconfig
JSON_C_DIR=/path/to/json_c/install
CFLAGS += -I$(JSON_C_DIR)/include/json-c
LDFLAGS+= -L$(JSON_C_DIR)/lib -ljson-c

相关文章:

  • 2021-08-24
  • 2021-03-31
  • 2021-08-12
  • 2021-08-21
  • 2021-04-24
  • 2021-11-18
  • 2021-11-20
  • 2021-11-21
猜你喜欢
  • 2021-11-06
  • 2022-12-23
  • 2021-05-27
  • 2021-05-22
  • 2022-12-23
  • 2021-05-30
  • 2021-10-08
相关资源
相似解决方案