A C++ library for interacting with JSON.

Related tags

JSON jsoncpp
Overview

JsonCpp

badge badge badge Coverage Status

JSON is a lightweight data-interchange format. It can represent numbers, strings, ordered sequences of values, and collections of name/value pairs.

JsonCpp is a C++ library that allows manipulating JSON values, including serialization and deserialization to and from strings. It can also preserve existing comment in unserialization/serialization steps, making it a convenient format to store user input files.

Documentation

JsonCpp documentation is generated using Doxygen.

A note on backward-compatibility

  • 1.y.z is built with C++11.
  • 0.y.z can be used with older compilers.
  • 00.11.z can be used both in old and new compilers.
  • Major versions maintain binary-compatibility.

Special note

The branch 00.11.zis a new branch, its major version number 00 is to show that it is different from 0.y.z and 1.y.z, the main purpose of this branch is to make a balance between the other two branches. Thus, users can use some new features in this new branch that introduced in 1.y.z, but can hardly applied into 0.y.z.

Using JsonCpp in your project

The vcpkg dependency manager

You can download and install JsonCpp using the vcpkg dependency manager:

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install jsoncpp

The JsonCpp port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.

Amalgamated source

https://github.com/open-source-parsers/jsoncpp/wiki/Amalgamated-(Possibly-outdated)

The Meson Build System

If you are using the Meson Build System, then you can get a wrap file by downloading it from Meson WrapDB, or simply use meson wrap install jsoncpp.

Other ways

If you have trouble, see the Wiki, or post a question as an Issue.

License

See the LICENSE file for details. In summary, JsonCpp is licensed under the MIT license, or public domain if desired and recognized in your jurisdiction.

Comments
  • Use a consistent target name for jsoncpp in CMake scripts

    Use a consistent target name for jsoncpp in CMake scripts

    The target name for the jsoncpp library would change based on whether we were building a static or shared library. This inconsistency made it difficult and unintuitive to pull in jsoncpp as a submodule in another repository and link to it directly via other CMake scripts.

    Having a consistent target name will allow libraries with their own CMake scripts to reliably refer to jsoncpp as a dependency. Example CMake script below shows how I would refer to jsoncpp as a dependency in my own parent project. Note that jsoncpp in this case is a submodule in my git repository.

    set( project_name my-project )
    
    project( ${project_name} )
    
    set( sources
        main.cpp
    )
    
    add_subdirectory( jsoncpp )
    
    add_executable( ${project_name} ${sources} )
    target_link_libraries( ${project_name} PRIVATE jsoncpp )
    

    Other Changes:

    • BUILD_SHARED_LIBS and BUILD_STATIC_LIBS removed in favor of JSONCPP_LIBRARY_TYPE, which allows you to pick either SHARED or STATIC library variations. This change was made to prevent both shared and static libraries being built at the same time. This isn't allowed anymore since we only generate 1 target for the jsoncpp library now.
    • Clean up closing statements for if conditions, functions, macros, and other entities. Newer versions of CMake do not require you to redundantly respecify the parameters to the opening arguments.
    • travis.sh build script updated to perform CMake generation in an out-of-source binary directory. This will prevent the temporary generated output files from intermixing into the source tree and allow for multiple generations with different configurations using the same source tree.
    enhancement 
    opened by rcdailey 30
  • Building SHARED and STATIC library

    Building SHARED and STATIC library

    As I can see, it is currently not possible to build both versions, correct?

    Would a PR that offers this functionality be merged? I want to package a more recent version for debian, which requires .a and .so version of it.

    enhancement 
    opened by cinemast 29
  • Bug: can't create array more than 5 items

    Bug: can't create array more than 5 items

    test code is:

        int count = 5;
        Json::Value root;
        Json::Value item;
        root["array"] = Json::Value::nullRef;
        for (int i = 0; i < count; i++)
        {
            item["a"] = i;
            item["b"] = i;
            root["array"][i] = item;
        }
    

    the above code's result is wrong,

    {
       "array" : [
          {
             "a" : 0,
             "b" : 0
          }
       ]
    }
    

    but if when the count = 4, then the result is right:

    {
       "array" : [
          {
             "a" : 0,
             "b" : 0
          },
          {
             "a" : 1,
             "b" : 1
          },
          {
             "a" : 2,
             "b" : 2
          },
          {
             "a" : 3,
             "b" : 3
          }
       ]
    }
    
    opened by gzliudan 27
  • Fix non-rvalue Json::Value assignment operator (should copy, not move)

    Fix non-rvalue Json::Value assignment operator (should copy, not move)

    Pull request #635 has changed the behavior of non-rvalue assignment operator from copying the 'other' value to swapping with it. There is a lot of wrong with it.

    This pull request reverts to the earlier assignment operator, with 'other' passed by value rather than const&. Now that Json::Value has a move constructor, such assignment operator covers both move and non-move cases.

    opened by cfyzium 26
  • Memory leak issue in jsoncpp ver 0.10.7(0.y.z)

    Memory leak issue in jsoncpp ver 0.10.7(0.y.z)

    We tried to feed 128KB data in JSON parser API , which took almost 2MB of memory .

    Please find the below code for your reference ,

    if(!reader.parse(buf, root)) { return false; }

    Could you please provide your input on this .

    Thanks & Regards, Subitha.P

    opened by subithaparamasivan 24
  • Failing ValueTest/integers unit test (32-bit gcc Linux RelWithDebInfo)

    Failing ValueTest/integers unit test (32-bit gcc Linux RelWithDebInfo)

    I'm building with CMake and getting the following error from the unit tests:

    Testing ValueTest/checkNormalizeFloatingPointStr: OK
    Testing ValueTest/memberCount: OK
    Testing ValueTest/objects: OK
    Testing ValueTest/arrays: OK
    Testing ValueTest/null: OK
    Testing ValueTest/strings: OK
    Testing ValueTest/bools: OK
    Testing ValueTest/integers: FAILED
    Testing ValueTest/nonIntegers: OK
    Testing ValueTest/compareNull: OK
    Testing ValueTest/compareInt: OK
    Testing ValueTest/compareUInt: OK
    Testing ValueTest/compareDouble: OK
    Testing ValueTest/compareString: OK
    Testing ValueTest/compareBoolean: OK
    Testing ValueTest/compareArray: OK
    Testing ValueTest/compareObject: OK
    Testing ValueTest/compareType: OK
    Testing ValueTest/offsetAccessors: OK
    Testing ValueTest/typeChecksThrowExceptions: OK
    Testing ReaderTest/parseWithNoErrors: OK
    Testing ReaderTest/parseWithNoErrorsTestingOffsets: OK
    Testing ReaderTest/parseWithOneError: OK
    Testing ReaderTest/parseChineseWithOneError: OK
    Testing ReaderTest/parseWithDetailError: OK
    Testing WriterTest/dropNullPlaceholders: OK
    * Detail of ValueTest/integers test failure:
    /home/eric/Development/jsoncpp/src/test_lib_json/main.cpp(664): kfint32max == val.asFloat()
      Expected: 2147483648
      Actual  : 2147483648
    25/26 tests passed (1 failure(s))
    make[2]: *** [jsoncpp/bin/jsoncpp_test] Error 1
    make[1]: *** [jsoncpp/src/test_lib_json/CMakeFiles/jsoncpp_test.dir/all] Error 2
    make: *** [all] Error 2
    

    Is this an issue in the code or maybe specific to my setup?

    bug 
    opened by emarthinsen 23
  • GCC6 Support

    GCC6 Support

    Hi!

    At Debian we are currently preparing the migration to GCC6. The following issues are currently affecting libjsoncpp.

    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=811958

    Could you take a look at it?

    opened by cinemast 22
  • move ctors

    move ctors

    • Add move constructor to Value::CZString
    • Add unit test for Value move constructor
    • Allow includer to specify in advance the value for JSON_HAS_RVALUE_REFERENCES

    rebased #264.

    opened by cdunn2001 22
  • undefined reference to `Json::Value::Value(Json::ValueType)'

    undefined reference to `Json::Value::Value(Json::ValueType)'

    I use clion. I want to use json library. But i have soo many problems. Firstly undefined reference to `Json::Value::Value(Json::ValueType)'. How can i solve this problem.

    help wanted 
    opened by FatmanurKucukayvaz 21
  • Json testing with equals is failing.

    Json testing with equals is failing.

    I'm trying to test if 2 pieces of json is the same but having trouble with this one test. This is the console output below, is this a bug or am I doing equals testing wrong?

     FAILED:
      REQUIRE( returnJson == CEJsonHelper::parse( "{\"apiVersion\" : \"1.0.0\",\"inEffect\" : false,\"methodCaller\" : \"getDuckworthLewisStern\",\"oversRemainingIncludingBreaks\" : -1,\"oversUsedIncludingBreaks\" : -1,\"parScore\" : -1,\"projectedScore\" : -1,\"runsToWin\" : -1,\"runsToWinPerOver\" : -1,\"runsToWinPerOverAverage\" : -1,\"showResults\" : false,\"targetScore\" : -1,\"validResult\" : false,\"winningBy\" : -1,\"methodCaller\":\"getDuckworthLewisStern\"}") )
    with expansion:
    {
     "apiVersion" : "1.0.0",
      "inEffect" : false,
      "methodCaller" : "getDuckworthLewisStern",
      "oversRemainingIncludingBreaks" : -1,
      "oversUsedIncludingBreaks" : -1,
      "parScore" : -1,
      "projectedScore" : -1,
      "runsToWin" : -1,
      "runsToWinPerOver" : -1,
      "runsToWinPerOverAverage" : -1,
      "showResults" : false,
      "targetScore" : -1,
      "validResult" : false,
      "winningBy" : -1
      }
      ==
      {
      "apiVersion" : "1.0.0",
      "inEffect" : false,
      "methodCaller" : "getDuckworthLewisStern",
      "oversRemainingIncludingBreaks" : -1,
      "oversUsedIncludingBreaks" : -1,
      "parScore" : -1,
      "projectedScore" : -1,
      "runsToWin" : -1,
      "runsToWinPerOver" : -1,
      "runsToWinPerOverAverage" : -1,
      "showResults" : false,
      "targetScore" : -1,
      "validResult" : false,
      "winningBy" : -1
      }
    
    bug help wanted 
    opened by dan-ryan 18
  • isfinite compilation error

    isfinite compilation error

    Building CXX object myProject/third/CMakeFiles/third.dir/jsoncpp.cpp.o
    /home/vagrant/myProject/myProject/third/jsoncpp.cpp: In function ‘std::string Json::valueToString(double)’:
    /home/vagrant/myProject/myProject/third/jsoncpp.cpp:4049:21: error: ‘isfinite’ was not declared in this scope
       if (isfinite(value)) {
                         ^
    /home/vagrant/myProject/myProject/third/jsoncpp.cpp:4049:21: note: suggested alternative:
    In file included from /usr/include/c++/4.8/random:38:0,
                     from /usr/include/c++/4.8/bits/stl_algo.h:65,
                     from /usr/include/c++/4.8/algorithm:62,
                     from /home/vagrant/myProject/myProject/third/jsoncpp.cpp:2398:
    /usr/include/c++/4.8/cmath:596:5: note:   ‘std::isfinite’
         isfinite(_Tp __x)
         ^
    make[2]: *** [myProject/third/CMakeFiles/third.dir/jsoncpp.cpp.o] Error 1
    make[1]: *** [myProject/third/CMakeFiles/third.dir/all] Error 2
    make: *** [all] Error 2
    

    This is on Ubuntu Trusty, failing here (I am using an amalgamated version of SHA ed495edcc1bda878ef3cabd4c1ddaa1cdf2c57b0). For me, replacing isfinite() with std::isfinite() at that line let me compile. However due to the cross-platform support for isfinite here this isn't the real solution.

    opened by connormanning 18
  • TESTING: legacy_test_real13.json parsing failed.

    TESTING: legacy_test_real13.json parsing failed.

    Hi!

    I'm using latest jsoncpp from master, on a Windows 10 dev box with Visual Studio 2019

    Build has been configured with CMake :

    cmake -B ~/build/cpp/www-git/jsoncpp -D CMAKE_CONFIGURATION_TYPES=Release \
    -D CMAKE_INSTALL_PREFIX=~/build/cpp/www-git/jsoncpp/install -D BUILD_SHARED_LIBS=ON -D JSONCPP_WITH_TESTS=ON \
    -D JSONCPP_WITH_POST_BUILD_UNITTEST=ON -D JSONCPP_WITH_EXAMPLE=ON
    

    Everything builds fine, but one test (only one of all tests) in jsoncpp_readerwriter_tests fails :

    Excerpts from the output log of "Build Solution" in VS 2019 :

    18>C:\Users\olivier\build\cpp\www-git\jsoncpp\bin\Release\jsontestrunner_exe.exe  --json-writer StyledWriter "C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_real_11.json"
    18>C:\Users\olivier\build\cpp\www-git\jsoncpp\bin\Release\jsontestrunner_exe.exe  --json-writer StyledWriter "C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_real_12.json"
    18>C:\Users\olivier\build\cpp\www-git\jsoncpp\bin\Release\jsontestrunner_exe.exe  --json-writer StyledWriter "C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_real_13.json"
    18>Failed to parse input file:
    18>* Line 1, Column 2
    18>  '-1e+9999' is not a number.
    18>
    18>C:\Users\olivier\build\cpp\www-git\jsoncpp\bin\Release\jsontestrunner_exe.exe  --json-writer StyledWriter "C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_string_01.json"
    18>C:\Users\olivier\build\cpp\www-git\jsoncpp\bin\Release\jsontestrunner_exe.exe  --json-writer StyledWriter "C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_string_02.json"
    18>C:\Users\olivier\build\cpp\www-git\jsoncpp\bin\Release\jsontestrunner_exe.exe  --json-writer StyledWriter "C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_string_03.json"
    
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\fail_invalid_quote.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\fail_test_array_01.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\fail_test_array_02.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\fail_test_object_01.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\fail_test_stack_limit.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_array_01.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_array_02.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_array_03.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_array_04.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_array_05.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_array_06.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_array_07.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_basic_01.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_basic_02.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_basic_03.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_basic_04.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_basic_05.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_basic_06.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_basic_07.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_basic_08.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_basic_09.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_comment_00.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_comment_01.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_comment_02.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_complex_01.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_integer_01.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_integer_02.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_integer_03.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_integer_04.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_integer_05.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_integer_06_64bits.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_integer_07_64bits.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_integer_08_64bits.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_large_01.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_object_01.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_object_02.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_object_03.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_object_04.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_preserve_comment_01.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_real_01.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_real_02.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_real_03.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_real_04.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_real_05.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_real_06.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_real_07.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_real_08.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_real_09.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_real_10.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_real_11.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_real_12.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_real_13.json parsing failed
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_string_01.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_string_02.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_string_03.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_string_04.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_string_05.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_string_unicode_01.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_string_unicode_02.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_string_unicode_03.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_string_unicode_04.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_string_unicode_05.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\test_array_08.json OK
    18>TESTING: C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\test_object_05.json OK
    18>
    18>Failure details:
    18>* Test C:\Users\olivier\dev\cpp\www-git\jsoncpp\test\data\legacy_test_real_13.json
    18>Parsing failed:
    18>
    18>
    18>Test results: 63 passed, 1 failed.
    

    Not sure what's going on here...

    Shouldn't '-1e+9999' be a 'number' as expected by the test ?

    opened by olivier-fs 0
  • Fix asserts in Value::setComment

    Fix asserts in Value::setComment

    The existing asserts seem to not be what was intended; they appear to have been mistranslated in pull/877.

    The first assert for comment.empty() was previously a check that a provided const char* parameter was not null. The function this replaced accepted empty strings, and the if() statement at the start of this function handles them.

    The second assert for comment[0] == '\0' was written when comment was a const char*, and was testing for empty c-string input. This PR replaces it with comment.empty() to match the original intent.

    opened by vslashg 0
  • Proposal: define exceptions when !JSON_USE_EXCEPTION

    Proposal: define exceptions when !JSON_USE_EXCEPTION

    The current behavior of only defining these classes when exceptions are enabled creates difficulties for large projects with trees of dependencies.

    OSS libraries will often reasonably try/catch on these exceptions, which causes those libraries not to build when !JSON_USE_EXCEPTION. This is easy to miss in those libraries, which don't test for nonstandard configurations of their dependencies, but it makes those libraries difficult to use in projects with large dependency trees that have already configured jsoncpp in this way.

    opened by vslashg 1
  • qemu-arm: Could not open '/lib/ld-linux.so.3': No such file or directory

    qemu-arm: Could not open '/lib/ld-linux.so.3': No such file or directory

    I'm trying to cross-compile for the armv7l architecture using the compiler arm-linux-gnueabi-g++. Founding the issue #243 can be used as reference to try an approach, so i ran: Using this file as toolchain file.

    mkdir build
    cd build
    cmake -DCMAKE_BUILD_TYPE=none -DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=OFF -DARCHIVE_INSTALL_DIR=. -DCMAKE_TOOLCHAIN_FILE=~/toolchain-arm-linux-gnueabi.cmake -G "Unix Makefiles" ..
    make
    

    And the output for the make command was:

    ...
    Scanning dependencies of target jsoncpp_test
    [ 76%] Building CXX object src/test_lib_json/CMakeFiles/jsoncpp_test.dir/jsontest.cpp.o
    [ 84%] Building CXX object src/test_lib_json/CMakeFiles/jsoncpp_test.dir/fuzz.cpp.o
    [ 92%] Building CXX object src/test_lib_json/CMakeFiles/jsoncpp_test.dir/main.cpp.o
    [100%] Linking CXX executable ../../bin/jsoncpp_test
    qemu-arm: Could not open '/lib/ld-linux.so.3': No such file or directory
    make[2]: *** [src/test_lib_json/CMakeFiles/jsoncpp_test.dir/build.make:116: bin/jsoncpp_test] Error 255
    make[2]: *** Deleting file 'bin/jsoncpp_test'
    make[1]: *** [CMakeFiles/Makefile2:1099: src/test_lib_json/CMakeFiles/jsoncpp_test.dir/all] Error 2
    make: *** [Makefile:141: all] Error 2
    

    My System infos:

    • Linux 5.10.102.1-microsoft-standard-WSL2 # 1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 x86_64
    • cmake version 3.16.3
    • jsoncpp version 1.9.5
    opened by LOCNNIL 1
  • jsoncpp:x64-linux is already installed BUT cannot find -ljsoncpp: No such file or directory

    jsoncpp:x64-linux is already installed BUT cannot find -ljsoncpp: No such file or directory

    Describe the bug I have installed by vcpk method and got "jsoncpp:x64-linux is already installed" as response; but when I compile the example it still exhibits error: cannot find -ljsoncpp: No such file or directory. And I cannot find libjsoncpp in /usr either. what's wrong in this case?

    Desktop (please complete the following information):

    • OS: ubuntu-22.04
    opened by beefsoup18 0
Releases(1.9.5)
  • 1.9.5(Nov 3, 2021)

  • 1.9.4(Sep 26, 2020)

    This patch contains several fixes found through the OSS-Fuzz project fuzzing, increasing the security of the library, as well as some fixes for different build systems.

    Source code(tar.gz)
    Source code(zip)
  • 1.9.3(May 29, 2020)

    Fix #1181 : Update the version tag - 1.9.3.


    This release includes several important bug fixes for unblocking some consumer's use cases.

    1. Fixes to JSON_USE_EXCEPTION--some bugs creeped in breaking this flag in pre-release.
    2. Fixes to build system--improvements have been make for code correctness.
    3. Compile errors for various platforms have been resolved.
    4. Fuzzing has been fixed.
    5. Various bugs in the Reader and Writer code have been corrected.
    6. CPPTL support has been dropped.
    7. Various code improvements and optimizations.
    Source code(tar.gz)
    Source code(zip)
  • 00.11.0(Apr 30, 2020)

    This release is based on branch 00.11.z, which is different from branch 0.y.z and 1.y.z.

    The main purpose of this release is to give users a third choice, that is, users can only have a copy of the code, but can build in different environments, so it can be used with old or newer compilers.

    The benefit is that users can use some new features in this new branch that introduced in 1.y.z, but can hardly applied into 0.y.z.

    All changes in the source code are for compatibility with pre-C++11 and C++11 standards. At the same time , we add more CIs to ensure all changes in all environments can work well.

    Source code(tar.gz)
    Source code(zip)
  • 1.9.2(Nov 13, 2019)

    We are still working towards a release that we consider completely "stable." However, since multiple build fixes have been consumed since 1.9.1, here is a prerelease 1.9.2 build that contains those fixes.

    Source code(tar.gz)
    Source code(zip)
  • 1.9.1(Jul 11, 2019)

  • 1.9.0(Jul 2, 2019)

    It's been ~2 years since the last release, so this has quite a few changes. Some highlights:

    • Build optimizations and updates. Now needs at least Meson 0.50.0, bot support for VS 2013 dropped in favor of VS 2017 (#952, #955, #934, #933, #932, #911, #883, many others...).
    • Lots of bug fixes (incl. #902, #872, #869,
    • Lots of enhancements (#873, #
    • Lots of cleanup (#870, #867, #865, #864, #847, #849, ...)

    Mostly minor bug fixes and improvements, not too many big changes--not ready for version 2.0.0 release yet.

    Source code(tar.gz)
    Source code(zip)
  • 0.10.7(Dec 4, 2018)

    Needed for https://github.com/open-source-parsers/jsoncpp/issues/828#issuecomment-443533340

    If this is really a minor update, sorry. And sorry for not updating the version string in the source-code. No time. A PR would be accepted.

    Source code(tar.gz)
    Source code(zip)
  • 1.8.4(Dec 20, 2017)

    • Functional changes
      • Serialize UTF-8 string with Unicode escapes (#687)
        • This will break anyone who relied on not Unicode-escaping their encoding strings.
        • See discussion at #687. (A future release might allow skipping all Unicode escape.)
      • Un-deprecate removeMember overloads, return void (#693)
      • Allow Json::Value to be used in a boolean context (#695)
      • Use move ctor in append() (#677)
      • Add value_type to improve integration with boost (#671)
    • Meta-changes
      • Fix meson.build to allow using jsoncpp as a subproject
      • Fix some compiler warnings
      • Update docs
      • Update for TravisCI
    Source code(tar.gz)
    Source code(zip)
  • 1.8.3(Aug 30, 2017)

  • 1.8.2(Aug 27, 2017)

    • Some C++ "move" operators.
      • (If these require a bump in the ABI number, please let us know.)
    • Fix uninitialized value detected by valgrind. (Thanks to @ya1gaurav for first noticing this.)
    • Other minor improvements.
    • Moved most READ docs to Wiki.
    Source code(tar.gz)
    Source code(zip)
  • 1.8.1(Jun 26, 2017)

  • 1.8.0(Dec 14, 2016)

    Plus some other build-related changes. I don't think there is anything functionally different from 1.7.7, or even any binary incompatibilities, but the cmake change is significant.

    Source code(tar.gz)
    Source code(zip)
  • 1.7.7(Oct 2, 2016)

    At the suggestion of Peter Spiess-Knafl, we will bump the SOVERSION independent of the MAJOR.MINOR.MICRO version, in case we break binary compatibility.

    Source code(tar.gz)
    Source code(zip)
  • 1.7.6(Sep 26, 2016)

  • 1.7.5(Sep 1, 2016)

    • Fix locale for decimal points
      • Plus a fix for Android
    • int64_t for 64-bit integers
    • Optionally suppress space after comma
    • Avoid null for empty stringValue
    • Fix null ctor/dtor, using a "Meyers Singleton"
      • Thanks to @marklakata and @BillyDonahue in #488 in #490.
    Source code(tar.gz)
    Source code(zip)
  • 1.7.4(Jul 9, 2016)

  • 1.7.3(Jun 27, 2016)

    • Fix static initialization of null with Myers Singleton. (Thanks @marklakata )
    • Fix other minor compiler and installation problems and warnings.
    • Fix amalgamated header.
    Source code(tar.gz)
    Source code(zip)
  • 1.7.2(Mar 25, 2016)

  • 1.7.1(Mar 22, 2016)

    • New precision setting in StreamBuilder
    • Move-semantics for some ctors
    • Added details to exception messages
      • Clarified when exceptions are thrown
    • Support isinfinite()
    • Secure memory-wiping allocator (via compilation flag, settable via cmake)
      • For this, we changed all STL datatypes to macros, but all unchanged by default.
    • Lots of minor build-related improvements
      • Notably, cmake support for ccache
      • More supported systems
        • gcc-6
        • musl
        • MinGW
        • Cygwin
        • QNX
        • VS2010 (for now, but you can always use old versions of JsonCpp)

    Note: 1.7.0 was recalled b/c it accidentally included SecureAlloc by default.

    Source code(tar.gz)
    Source code(zip)
    jsoncpp-1.7.1.tar.gz.asc(473 bytes)
  • 1.6.5(Jul 23, 2015)

  • 0.10.5(Jul 23, 2015)

  • 0.10.4(Jul 12, 2015)

    We have done some house-keeping, so even tough the only real change here is a minor bug-fix, this release is an improvement.

    • -Werror
    • -Wshadow, plus a big-fix found from it
    • fixed most warnings (but still cannot use -Wconversion with older compilers, or -Wsign-conversion with newer)
    • dockerized Travis CI builds
    • explicitly use older compiler in Travis (gcc-4.6, while master branch uses gcc-4.9 or later, plus -std=c++11)

    (0.10.3 was a non-release because of a signing error in 0.10.2.)

    Source code(tar.gz)
    Source code(zip)
    jsoncpp-0.10.4.tar.gz.asc(473 bytes)
  • 0.10.2-p1(Jun 19, 2015)

  • 1.6.2(Apr 11, 2015)

    • Do not truncate output at embedded zeroes.

    This was already fixed the new StreamWriter, which is used by the default stream inserter. This fix will not break anything that wasn't already broken.

    Source code(tar.gz)
    Source code(zip)
  • 0.10.2(Apr 11, 2015)

  • 1.6.1(Mar 31, 2015)

  • 0.10.1(Mar 31, 2015)

Owner
null
A C++ library for interacting with JSON.

JsonCpp JSON is a lightweight data-interchange format. It can represent numbers, strings, ordered sequences of values, and collections of name/value p

null 6.8k Nov 18, 2022
A killer modern C++ library for interacting with JSON.

JSON Voorhees Yet another JSON library for C++. This one touts new C++11 features for developer-friendliness, an extremely slow-speed parser and no de

Travis Gockel 124 Oct 26, 2022
json-cpp is a C++11 JSON serialization library.

JSON parser and generator for C++ Version 0.1 alpha json-cpp is a C++11 JSON serialization library. Example #include <json-cpp.hpp> struct Foo {

Anatoly Scheglov 7 Oct 30, 2022
This is a JSON C++ library. It can write and read JSON files with ease and speed.

Json Box JSON (JavaScript Object Notation) is a lightweight data-interchange format. Json Box is a C++ library used to read and write JSON with ease a

Anhero inc. 109 Nov 3, 2022
A convenience C++ wrapper library for JSON-Glib providing friendly syntactic sugar for parsing JSON

This library is a wrapper for the json-glib library that aims to provide the user with a trivial alternative API to the API provided by the base json-

Rob J Meijer 17 Oct 19, 2022
json-build is a zero-allocation JSON serializer compatible with C89

json-build is a zero-allocation JSON serializer compatible with C89. It is inspired by jsmn, a minimalistic JSON tokenizer.

Lucas Müller 31 Nov 16, 2022
An easy-to-use and competitively fast JSON parsing library for C++17, forked from Bitcoin Cash Node's own UniValue library.

UniValue JSON Library for C++17 (and above) An easy-to-use and competitively fast JSON parsing library for C++17, forked from Bitcoin Cash Node's own

Calin Culianu 24 Sep 21, 2022
A Haskell library for fast decoding of JSON documents using the simdjson C++ library

hermes A Haskell interface over the simdjson C++ library for decoding JSON documents. Hermes, messenger of the gods, was the maternal great-grandfathe

Josh Miller 37 Nov 9, 2022
C library for encoding, decoding and manipulating JSON data

Jansson README Jansson is a C library for encoding, decoding and manipulating JSON data. Its main features and design principles are: Simple and intui

Petri Lehtinen 2.7k Nov 19, 2022
A very sane (header only) C++14 JSON library

JeayeSON - a very sane C++14 JSON library JeayeSON was designed out of frustration that there aren't many template-based approaches to handling JSON i

Jeaye Wilkerson 129 Oct 27, 2022
A tiny JSON library for C++11.

json11 json11 is a tiny JSON library for C++11, providing JSON parsing and serialization. The core object provided by the library is json11::Json. A J

Dropbox 2.4k Nov 22, 2022
a JSON parser and printer library in C. easy to integrate with any model.

libjson - simple and efficient json parser and printer in C Introduction libjson is a simple library without any dependancies to parse and pretty prin

Vincent Hanquez 260 Nov 21, 2022
Lightweight JSON library written in C.

About Parson is a lightweight json library written in C. Features Full JSON support Lightweight (only 2 files) Simple API Addressing json values with

Krzysztof Gabis 1.2k Nov 19, 2022
QJson is a qt-based library that maps JSON data to QVariant objects.

QJson JSON (JavaScript Object Notation) is a lightweight data-interchange format. It can represents integer, real number, string, an ordered sequence

Flavio Castelli 273 Nov 14, 2022
C++ header-only JSON library

Welcome to taoJSON taoJSON is a C++ header-only JSON library that provides a generic Value Class, uses Type Traits to interoperate with C++ types, use

The Art of C++ 493 Nov 15, 2022
A fast streaming JSON parsing library in C.

********************************************************************** This is YAJL 2. For the legacy version of YAJL see https

Lloyd Hilaiel 2.1k Nov 19, 2022
Very fast Python JSON parsing library

cysimdjson Fast JSON parsing library for Python, 7-12 times faster than standard Python JSON parser. It is Python bindings for the simdjson using Cyth

TeskaLabs 230 Nov 20, 2022
Immediate Mode JSON Serialization Library in C

JIM Immediate Mode JSON Serialization Library in C. Similar to imgui but for generating JSON. Example example.c: #include <stdio.h> #define JIM_IMPLE

Tsoding 32 Nov 17, 2022
📟 JSON library for Arduino and embedded C++. Simple and efficient.

ArduinoJson is a C++ JSON library for Arduino and IoT (Internet Of Things). Features JSON deserialization Optionally decodes UTF-16 escape sequences t

Benoît Blanchon 5.9k Nov 20, 2022