I'm trying to use libjson within a C++ project and the docs tell me to just "add libjson's source to your project, comment JSON_LIBRARY in the JSONOptions.h file and any C++ compiler should compile it."
Being quite new to C++ and all that, how exactly am I supposed to do that (not using any IDE)? Should I just #include
the libjson.h file and that's it? Shouldn't I reference libjson somehow in my call to g++ when compiling my project?
thx in advance
You have to:
One,
in order to get access to the functions and data types the library offers, then
Two, link against the libjsonz library:
(the
-ljson
flag has to come last or you'll get a linker error with never versions of GCC.)EDIT: if you need to build the library, you typically have a configure script or a Makefile. See how to use them.