jsoncpp linux平台编译和 arm移植

前端之家收集整理的这篇文章主要介绍了jsoncpp linux平台编译和 arm移植前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

转自 :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

猜你在找的Json相关文章