I am trying to compile a sample jsoncpp example, but there are tons of compiling errors showing up in \"standard\" headers. did any body see this any time ?
[~]
Check JSON include path. In compilation option use -I/path of JSON include directory
, e.g. -I$(pkg-config --cflags jsoncpp)
.
If you compile with -I.../include/json
, then the standard library might accidentally include a JSON header. (In this case, according to asuter, it was features.h
.)
The parent directory is a kind of "namespace" for header files. That's why a good practice for any library with headers like incdir/foo/bar.h
is -Iincdir
and #include <foo/bar.h>
.
That's the kind of thing that would happen if one of your headers that preceded it had a syntax error such as a missing ;
at end of class declaration. Start by cleaning those.
You need to include header file using this way: #include "json/json.h"
For me it was the features.h included with json-cpp conflicting with the system features.h in some other includes. I renamed it locally to json_features.h in the json-cpp code and all was well.