Skip to content
Working clone of the official json-c repository http://oss.metaparadigm.com/json-c/
C Shell HTML Makefile
Find file
Pull request Compare This branch is even with json-c:master.
Failed to load latest commit information.
autoconf-archive Use AX_APPEND_COMPILE_FLAGS() to check the various compile flags, suc…
tests Fix issue #201: add a JSON_C_TO_STRING_NOSLASHESCAPE flag to turn off…
.gitignore Issue #137: remove config.h.in from change control.
.travis.yml Travis: add osx and clang builds
AUTHORS Add Jehiah and myself to the list of authors.
Android.configure.mk Add an Android-friendly build system
COPYING Add my copyright.
ChangeLog Bump versions up to 0.12.99 since a 0.12 release was just created.
Doxyfile Bump versions up to 0.12.99 since a 0.12 release was just created.
Makefile.am Use AX_APPEND_COMPILE_FLAGS() to check the various compile flags, suc…
NEWS Add a dummy "NEWS" file to automake doesn't complain.
README Add an empty README file to placate autoconf.
README-WIN32.html strndup is gone, remove it from the README file.
README.html Update README files with pointers to new github repo and googlegroups…
README.md Fix minor typo in README file.
RELEASE_CHECKLIST.txt Issue #137: remove config.h.in from change control.
appveyor.yml Appveyor: Visual Studio v140 no longer fails
arraylist.c Slight style tweaks to the bsearch changest.
arraylist.h Slight style tweaks to the bsearch changest.
autogen.sh Use AX_APPEND_COMPILE_FLAGS() to check the various compile flags, suc…
bits.h Move the json_min() and json_max() macros to json_util.h and mark eve…
config.h.win32 Updated config for vs2010/winsdk71 as well as vs2013
configure.ac Use AX_APPEND_COMPILE_FLAGS() to check the various compile flags, suc…
debug.c Remove trailing whitespace
debug.h Eliminate the deprecated mc_abort() function and MC_ABORT macro.
json-c-uninstalled.pc.in Re-add the "json" pkg-config file as a compatibility shim.
json-c.pc.in Link against libm when needed
json-c.vcproj Adds json_config.h.win32 to project. Adds VS2k13 project.
json-c.vcxproj Build random_seed.c as well
json-c.vcxproj.filters Build random_seed.c as well
json.h Move the json_min() and json_max() macros to json_util.h and mark eve…
json_c_version.c Add a json_c_version.h header (included from json.h), and several mac…
json_c_version.h Bump versions up to 0.12.99 since a 0.12 release was just created.
json_config.h.in Include json_inttypes.h in json_object.h since we use types like int3…
json_config.h.win32 Updated config for vs2010/winsdk71 as well as vs2013
json_inttypes.h Define macros from inttypes.h when not available
json_object.c Add const qualifiers to several functions that don't modify the json_…
json_object.h Add const qualifiers to several functions that don't modify the json_…
json_object_iterator.c Since we already use a local json_bool type, replace any stdbool.h us…
json_object_iterator.h Issue #76: use old style comment to allow json_object_iterator.h to b…
json_object_private.h more efficient handling for smalls strings inside json_object
json_tokener.c Remove superfluous NULL checks
json_tokener.h Remove trailing whitespace
json_util.c Introduce json_object_from_fd
json_util.h Introduce json_object_from_fd
libjson.c Remove trailing whitespace
linkhash.c Merge commit '2be921d88376e78f84d79aafa6db2714da804e59'
linkhash.h Merge commit '2be921d88376e78f84d79aafa6db2714da804e59'
math_compat.h Define INFINITY and NAN when missing
printbuf.c Move the json_min() and json_max() macros to json_util.h and mark eve…
printbuf.h Remove the "#undef PRINTBUF_DEBUG" from printbuf.h so it can be more …
random_seed.c Add missing include file to random_seed
random_seed.h Patch to address the following issues:

README.md

json-c

Building on Unix with git, gcc and autotools

Home page for json-c: https://github.com/json-c/json-c/wiki

Caution: do NOT use sources from svn.metaparadigm.com, they are old.

Prerequisites:

  • gcc, clang, or another C compiler
  • libtool

If you're not using a release tarball, you'll also need:

  • autoconf (autoreconf)
  • automake

Make sure you have a complete libtool install, including libtoolize.

json-c GitHub repo: https://github.com/json-c/json-c

$ git clone https://github.com/json-c/json-c.git
$ cd json-c
$ sh autogen.sh

followed by

$ ./configure
$ make
$ make install

To build and run the test programs:

$ make check

Linking to libjson-c

If your system has pkgconfig, then you can just add this to your makefile:

CFLAGS += $(shell pkg-config --cflags json-c)
LDFLAGS += $(shell pkg-config --libs json-c)

Without pkgconfig, you would do something like this:

JSON_C_DIR=/path/to/json_c/install
CFLAGS += -I$(JSON_C_DIR)/include/json-c
LDFLAGS+= -L$(JSON_C_DIR)/lib -ljson-c
Something went wrong with that request. Please try again.