How to compile JSON-C – JSON implementation in C

JSON-C implements a reference counting object model that allows you to easily construct JSON objects in C, output them as JSON formatted strings and parse JSON formatted strings back into the C representation of JSON objects. It aims to conform to RFC 7159.

$ git clone git://github.com/json-c/json-c.git 

Compiling latest version of json-c

Check the latest branch available using “git branch -r” command and checkout to this branch as,

$ cd json-c 
$ git branch -r 
$ git checkout -b json-c-0.14 origin/json-c-0.14 
$ mkdir build 
$ cmake -DCMAKE_INSTALL_PREFIX=build . 

Above commands compiles json-c which can be installed in a “build” directory as,


Subscribe with Valid Email Id to receive updates in Inbox. ( Secured by Google FeedBurner )

   


$ make all test install 

You can see it got compiled and installed as,

$ tree build/
build/
├── include
│   └── json-c
│       ├── arraylist.h
│       ├── debug.h
│       ├── json_config.h
│       ├── json_c_version.h
│       ├── json.h
│       ├── json_inttypes.h
│       ├── json_object.h
│       ├── json_object_iterator.h
│       ├── json_pointer.h
│       ├── json_tokener.h
│       ├── json_types.h
│       ├── json_util.h
│       ├── json_visit.h
│       ├── linkhash.h
│       └── printbuf.h
└── lib
    ├── cmake
    │   └── json-c
    │       ├── json-c-config.cmake
    │       ├── json-c-targets.cmake
    │       └── json-c-targets-debug.cmake
    ├── libjson-c.so -> libjson-c.so.5
    ├── libjson-c.so.5 -> libjson-c.so.5.0.0
    ├── libjson-c.so.5.0.0
    └── pkgconfig
        └── json-c.pc

Compiling 0.12 version and earlier versions

$ git checkout -b json-c-0.12 origin/json-c-0.12 
$ mkdir build 
$ sudo apt-get install libtool
$ libtoolize
$ aclocal
$ autoheader
$ ./configure --prefix=./build
$ make
$ make install
lynxbee_ezoic

Leave a Comment

Android Android Build system Android Commands Android Java Applications Application Libraries Application Stack / User Interface Bash / Shell Scripts Bluetooth driver Cloud Technologies Commands and Packages Compilation Content Management System Core Kernel C Programs Development & Build Development, Debugging and Performance Tools Development Environment Setup Django & REST Api Errors & Failures Git Hardware Platforms HTML JAVA Programs Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL Multimedia Audio, Video, Images NDK / Middleware / HAL OS Concepts PHP Programming Languages Scripting and Automation Search Engine Optimisation ( SEO ) Social Media Source Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized Web design and development Website Hosting Wordpress Yocto / Bitbake / Openembedded