0

I am having trouble using the header files from jsoncpp in my program. I am trying to include the library globally through the use of a makefile CFLAGS, but its hard for me to figure out why its not working. This is what I have so far:
Error Code I receive Location of Jsoncpp header files enter image description here

Any help would greatly be appreciated. Thank you in advance!

I downloaded WSL and jsoncpp through the ubuntu terminal. When I tried running the make file, it said the given error. So I found the path to the files VSCode could not find and I tried to include it the make file. That did not work.

I also tried using VSCode's quick fix option that allowed me to edit its include path. But that didn't work either after I added it.

3
  • You added .../jsoncpp to your include path, but json.h is found in .../jsoncpp/json/ directory. Either change include path or #include "json/json.h" instead. Commented Nov 12, 2022 at 1:18
  • I tried adding/jsoncpp/json into the make file and it sitill produced the error. So next, i kept that the same, but I also added the #include "json/json.h" which almost worked. I had to do #include <jsoncpp/json/json.h> for it to work. Although if possible, I would prefer to use just <json.h>. Is there a different way to do this than what I am doing? Commented Nov 12, 2022 at 1:33
  • Uhm, I know little makefile, but quick duckduckgoing told me that variable for C++ flags is CXXFLAGS, not CFLAGS. And that should then have -I/user/include/jsoncpp/json Commented Nov 12, 2022 at 1:55

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.