Build
- SourceForge 에서 0.6.0RC 다운로드
- 압축 해제 및 폴더 이동
- tar zxvf jsoncpp-src-0.6.0-rc2.tar.gz
- cd jsoncpp-src-0.6.0-rc2
- scons 라는 python 으로 된 build 툴을 설치해야 한다.
- yum install scons -y
platform 에 맞는 build 환경 구성 & compile
scons platform=PLTFRM [TARGET]
PLTFRM 은 환경에 맞게 기술하면 되고 다음과 같은 값이 설정 가능 (README.txt 참고)
suncc Sun C++ (Solaris)
vacpp Visual Age C++ (AIX)
mingw
msvc6 Microsoft Visual Studio 6 service pack 5-6
msvc70 Microsoft Visual Studio 2002
msvc71 Microsoft Visual Studio 2003
msvc80 Microsoft Visual Studio 2005
msvc90 Microsoft Visual Studio 2008
linux-gcc Gnu C++ (linux, also reported to work for Mac OS X)사용하는 환경이 RHEL/CentOS 이므로 platform 에 linux-gcc 입력
- scons platform=linux-gcc
- test (check target 을 실행하면 됨)
- scons platform=linux-gcc check
Amalgamation
jsoncpp 를 library 로 만들지 않고 단일 source와 header 로 만들어서 프로젝트에 포함시킬수 있다.
- python amalgamate.py
다음과 같은 에러가 발생할 경우 파일 경로가 / 가 아니라 \ 로 되어서 발생한 문제이다. amalgamate.py 를 열어서 add_file에 \ 로 된 파일을 찾아서 / 로 바꾼후에