转自 :http://blog.csdn.net/a_ran/article/details/45277085
jsoncpp
soncpp is an implementation of a JSON (http://json.org) reader and writer in C++. JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate.
下载
@H_502_12@ http://sourceforge.net/projects/jsoncpp/或者到这里:http://download.csdn.net/detail/chinaeran/8631141
Linux平台编译
@H_502_12@ 解压后运行如下命令:# 先安装 scons $ sudo apt-get install scons $ scons platform=linux-gcc@H_502_12@ 目标路径:
动态库:./libs/linux-gcc-4.8/libjson_linux-gcc-4.8_libmt.so
静态库:./libs/linux-gcc-4.8/libjson_linux-gcc-4.8_libmt.a
arm平台编译
@H_502_12@ 注:platform 没有包含 arm 平台,类似 linux-gcc,所以把源码提取出来,独立编译解压后运行如下命令:
$ mkdir arm_jsoncpp $ cp include/ arm_jsoncpp/ -r $ cp src/lib_json/* arm_jsoncpp/ $ cd arm_jsoncpp/ # 编译静态库 $ arm-linux-gnueabihf-g++ -c *.cpp -I./include -fPIC $ ar cr libjsoncpp.a *.o # 编译动态库 $ arm-linux-gnueabihf-g++ -shared -fPIC *.cpp -include -o libjsoncpp.so@H_502_12@ 目标路径: 动态库:./arm_jsoncpp/libjsoncpp.so 静态库:./arm_jsoncpp/libjsoncpp.a