Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Official code repository for json-c. See the wiki for release tarballs for download.
C Shell HTML Other
Failed to load latest commit information.
tests Squash deprecated function warning by replacing json_object_object_ge…
.gitignore Add x64 build configurations
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 SONAME bump
Makefile.am.inc Patch to address the following issues:
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 Update the release checklist to include calculating the tarball check…
arraylist.c Slight style tweaks to the bsearch changest.
arraylist.h Slight style tweaks to the bsearch changest.
autogen.sh Default autogen.sh to not running configure, unless some command line…
bits.h Move the json_min() and json_max() macros to json_util.h and mark eve…
config.h.in Updated config for vs2010/winsdk71 as well as vs2013
config.h.win32 Updated config for vs2010/winsdk71 as well as vs2013
configure.ac Syntax error
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 Merge pull request #174 from haata/master
json_object.h Fix doc for json_object_new_boolean() to indicate the correct value f…
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 Add a json_set_serializer() function to allow the string output of a …
json_tokener.c json_tokener requires INF and NAN
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 Tell the compiler we're intentionally ignoring the return value from …
linkhash.h Remove trailing whitespace
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.