简体   繁体   English

如何在XCode上设置jsoncpp库?

[英]How to setup jsoncpp library on XCode?

After downloading JSON-CPP 0.5.0 and extracting it, I've no idea how to add it to my project on XCode. 下载JSON-CPP 0.5.0并将其解压缩后,我不知道如何将其添加到XCode上的项目中。 I couldn't find any steps online as well. 我也找不到在线的任何步骤。 Help please.. 请帮助..

I've also tried the steps in ReadMe file. 我还尝试了自述文件中的步骤。 But stuck after installing SCons. 但是在安装SCons之后卡住了。

SOLVED: 解决了:

Step1: Just add all the files inside the include directory and src/lib_json directory anywhere in the project. 步骤1:只需在项目中的任何位置的include目录和src / lib_json目录内添加所有文件。 (.h, .cpp etc.,) (.h,.cpp等),

Step2: You have to change the include file paths from #include "json/writer.h" to # include "writer.h" everywhere. 步骤2:您必须在所有地方将包含文件路径从#include "json/writer.h"更改为#include "json/writer.h" # include "writer.h" If you don't like the name "writer.h", you can very well rename it to "json_writer.h" or whatever. 如果您不喜欢名称“ writer.h”,则可以将其重命名为“ json_writer.h”或其他名称。

Step3: In the project settings, under Build phases, add the cpp files(that you added in step1) in the "Compile Sources". 步骤3:在项目设置的“构建阶段”下,将cpp文件(在步骤1中添加)添加到“编译源”中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM