json-c/0.17

JSON-C - A JSON implementation in C
Recipe info
2024-02-12

Available packages
Linux
Windows
macOS
macOS Apple Silicon

Install
Add the following line to your conanfile.txt:
[requires]
json-c/0.17

Using json-c

Note

If you are a new Conan user, we recommend reading the how to consume packages tutorial.

If you need additional assistance, please ask a question in the Conan Center Index repository.

Simplest use case consuming this recipe and assuming CMake as your local build tool:

[requires]
json-c/0.17
[generators]
CMakeDeps
CMakeToolchain
[layout]
cmake_layout
from conan import ConanFile
from conan.tools.cmake import cmake_layout


class ExampleRecipe(ConanFile):
    settings = "os", "compiler", "build_type", "arch"
    generators = "CMakeDeps", "CMakeToolchain"

    def requirements(self):
        self.requires("json-c/0.17")

    def layout(self):
        cmake_layout(self)

Now, you can run this Conan command to locally install (and build if necessary) this recipe and its dependencies (if any):

$ conan install conanfile.txt --build=missing

Useful information to take into account to consume this library:


These are the main declared targets:

  • CMake package name(s): json-c
  • CMake target name(s): json-c::json-c
  • pkg-config file name(s): json-c.pc

A simple use case using the CMake file name and the global target:

# ...
find_package(json-c REQUIRED)
# ...
target_link_libraries(YOUR_TARGET json-c::json-c)

These are all the available headers. Some of these ones might be non-public; make sure of it by visiting the json-c homepage listed above:

#include "arraylist.h"
#include "debug.h"
#include "json-c/arraylist.h"
#include "json-c/debug.h"
#include "json-c/json.h"
#include "json-c/json_c_version.h"
#include "json-c/json_config.h"
#include "json-c/json_inttypes.h"
#include "json-c/json_object.h"
#include "json-c/json_object_iterator.h"
#include "json-c/json_patch.h"
#include "json-c/json_pointer.h"
#include "json-c/json_tokener.h"
#include "json-c/json_types.h"
#include "json-c/json_util.h"
#include "json-c/json_visit.h"
#include "json-c/linkhash.h"
#include "json-c/printbuf.h"
#include "json.h"
#include "json_c_version.h"
#include "json_config.h"
#include "json_inttypes.h"
#include "json_object.h"
#include "json_object_iterator.h"
#include "json_patch.h"
#include "json_pointer.h"
#include "json_tokener.h"
#include "json_types.h"
#include "json_util.h"
#include "json_visit.h"
#include "linkhash.h"
#include "printbuf.h"