JSONCPP to Visual Studio

2018-06-17 20:50:40来源:未知 阅读 ()

新老客户大回馈,云服务器低至5折

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.

shareimprove this question
  •  
    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 – blakepeterman Nov 5 '14 at 22:54
  •  
    I basically do not know to take this library and use it in c++. – blakepeterman Nov 5 '14 at 22:55
  • 2
    The documentation is actually quite good -- I suggest following the instructions for generating an amalgamated .h & .cpp. Then you can just drop them into your project (Add->Existing Item in VS). After that all you need to do is include the header wherever you want to use jsoncpp. – Cameron Nov 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". – blakepeterman Nov 5 '14 at 23:16

1 Answer

activeoldestvotes
up vote1down vote

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).

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:VS2013 堆栈溢出调查(0xC00000FD: Stack overflow)

下一篇:数据结构之二叉树