JSONCPP to Visual Studio

I am having some trouble getting the JSONCPP Library into Visual Studio.

I have downloaded the library I am just unsure how to import it into my project and use it in my c++ code.

c++visual-studio-2013jsoncpp

shareimprove this question

askedNov 5 '14 at 22:47

blakepeterman

88311

  • What exactly is the problem? Is it a static library? DLL? Or do you have to compile it yourself?–CameronNov 5 '14 at 22:52

  • github.com/open-source-parsers/jsoncpp–blakepetermanNov 5 '14 at 22:54

  • I basically do not know to take this library and use it in c++.–blakepetermanNov 5 '14 at 22:55

  • 2

    The documentation is actually quite good -- I suggest following the instructions forgenerating an amalgamated .h & .cpp. Then you can just drop them into your project (Add->Existing Itemin VS). After that all you need to do is include the header wherever you want to use jsoncpp.–CameronNov 5 '14 at 23:06

  • I did that but I am getting a error: "cannot open include file: 'json/json.h' no such file or directory".–blakepetermanNov 5 '14 at 23:16

show3more comments

1 Answer

activeoldestvotes

1

To fix the error "cannot open include file: 'json/json.h' no such file or directory", you need to add Include directory to your project as following:

-Right click on your project -> Properties. Under C/C++ ->General ->Additional Include Directories, add C:\your-directory-to-jsoncpp-master\include (e.g. C:\user1\jsoncpp-master\include).

相关推荐