I need my project to be able to use json format.
I was suggested this github : https://github.com/open-source-parsers/jsoncpp I have been trying to integrate it to my project for multiple hours and still cant find the issue.
I still get these errors on my include :
#include <jsoncpp/json/json.h>
E1696 cannot open source file "jsoncpp/json/json.h"
C1083 Cannot open include file: 'jsoncpp/json/json.h'
I tried to go to C/C++ General->Additional Include Directories> to add the "jsoncpp-master\include" directory also tried "jsoncpp-master\include\json" directory also tried to add the .h and .cpp found in the repository directly.
I have also tried a multitude of other things but I'm not sure it would be relevant to list them all here.
I was not able to find instructions to use it with Visual Studio 2022 on their github either.
Safest and most convenient way to use third party libraries is to use package manager like vcpkg
https://vcpkg.io/en/index.html
https://github.com/microsoft/vcpkg
Choose what build you want x86 or x64 and set default triplet in your environment variables
If you have added
jsoncpp-master\includetoC/C++ General->Additional Include Directoriesthen you should use#include <json/json.h>instead of#include <jsoncpp/json/json.h>Explanation : The compiler is looking inside the include directory. If you observer the file structure you can see
jsonfolder is located in the include directory and notjsoncpp.