首页 > 代码库 > linux安装JSONCPP

linux安装JSONCPP

 

 
#tar -zxf scons-2.1.0.tar.gz
#cd scons-2.1.0
#python setup.py install
#tar -zxf jsoncpp-src-0.5.0.tar.gz
#cd jsoncpp-src-0.5.0
#scons platform=linux-gcc
#mv libs/linux-gcc-4.2.4/libjson_linux-gcc-4.2.4_libmt.so /lib
#mv include/json/ /usr/include/
#ldconfig
#./bin/linux-gcc-4.2.4/test_lib_json 注意这里的版本号可能不同
Testing ValueTest/size: OK
Testing ValueTest/isObject: OK
Testing ValueTest/isArray: OK
Testing ValueTest/isBool: OK
Testing ValueTest/isInt: OK
Testing ValueTest/isUInt: OK
Testing ValueTest/isDouble: OK
Testing ValueTest/isString: OK
Testing ValueTest/isNull: OK
All 9 tests passed


--------------
下载软件包:jsoncpp-src-0.5.0.tar.gz scons-2.1.0.tar.gz

# tar zxvf scons-2.1.0.tar.gz
# tar zxvf jsoncpp-src-0.5.0.tar.gz

设定环境变量【关键】,绝对路径
# export MYSCONS=解压的路径
# export SCONS_LIB_DIR=$MYSCONS/engine

# cd jsoncpp-src-0.5.0
# python $MYSCONS/script/scons platform=linux-gcc
编译成功后,在在jsoncpp-src-0.5.0/libs/目录下找到相应的*.a和*.so
可以修改为:mv libjson_linux-gcc-4.4.6_libmt.so libjson.so

linux安装JSONCPP