Skip to content
Jordan Bayles edited this page May 5, 2026 · 2 revisions

JsonCpp provides a script to generate an amalgamated source and header file. This is useful for projects that want to include JsonCpp without adding it as a full dependency or build system integration.

Generating Amalgamated Files

You can generate the amalgamated files by running the following Python script from the top-level directory of the JsonCpp source tree:

python3 amalgamate.py

This will create a dist directory containing:

  • jsoncpp.cpp: The complete source code.
  • json/json.h: The complete header file.
  • json/json-forwards.h: Forward declarations.

Integration

To use the amalgamated source in your project:

  1. Copy the dist directory contents into your project's source tree.
  2. Add jsoncpp.cpp to your build system's source files.
  3. Ensure your include paths are set up so that #include "json/json.h" works.

For more information, see the README.

Clone this wiki locally