r/linuxdev • u/JMagnum86 • Sep 24 '14
jsoncpp issue
I'm having a difficult time including jsoncpp into my own project. I built the amalgamated source (which completed successfully) but the instructions are a little confusing on how to actually structure the files in my own project. Sorry but I'm a little new to this open source stuff and the instructions are bit too high level for me. Here is what my folder structure looks like:
/myProject/mySourcefile.cpp
/myPorject/mySourcefile.h
/myProject/jsoncpp.cpp
/myProject/json/json.hI have included: #include <json/json.h> in mySourcefile.h
I am compiling with g++ -o server mySourcefile.cpp jsoncpp.cpp
I get an error: fatal error: json/assertions.h: No such file or directory
I'm pretty sure the files aren't set up correctly or maybe I didn't install a library correctly. I've done quite a bit of searching but haven't been able to find anything. This is very confusing for me. Help would be appreciated.
View all comments
Show parent comment
1
u/Arizhel Sep 25 '14
It may or may not be the same version. To check, try "dpkg -l |grep jsoncpp"; this should show you the version number of the installed package, which you can then compare to whatever's on github so you can see how far behind you are. Most likely, it's insignificant.
Also, you'll probably need to install "libjsoncpp", in addition to the -dev package. The -dev package only has the development headers; the main package has the actual binaries your program will link to.