两种方式,一种是源码编译,另一种是 apt 安装

  • 源码编译
# 下载源码包
git clone https://github.com/open-source-parsers/jsoncpp.git

cd jsoncpp

mkdir build
cd build

# 编译安装
cmake ..
make -j32
make install
  • apt 安装
sudo apt update
sudo apt-get install libjsoncpp-dev