- 下载Jsoncpp源码
1 | wget https://github.com/open-source-parsers/jsoncpp/archive/master.zip |
- 使用Cmake安装
1 | cd jsoncpp-master |
- 添加环境变量
1 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib |
- 编译时添加该库
代码中include就行
1 |
编译时
1 | g++ XXX -ljsoncpp |
1 | wget https://github.com/open-source-parsers/jsoncpp/archive/master.zip |
1 | cd jsoncpp-master |
1 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib |
代码中include就行
1 | #include <json/json.h> |
编译时
1 | g++ XXX -ljsoncpp |