0

After downloading JSON-CPP 0.5.0 and extracting it, I've no idea how to add it to my project on 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.

cegprakash
  • 2,937
  • 33
  • 60

1 Answers1

0

SOLVED:

Step1: Just add all the files inside the include directory and src/lib_json directory anywhere in the project. (.h, .cpp etc.,)

Step2: You have to change the include file paths from #include "json/writer.h" to # include "writer.h" everywhere. If you don't like the name "writer.h", you can very well rename it to "json_writer.h" or whatever.

Step3: In the project settings, under Build phases, add the cpp files(that you added in step1) in the "Compile Sources".

cegprakash
  • 2,937
  • 33
  • 60
  • Using `#include ` is a terrible solution. See [this](http://stackoverflow.com/questions/10256476/need-some-help-in-compiling-a-jsoncpp-sample-code/) for some problems that you can hit when you do not namespace your header files. There *must* be a way to make Xcode work. Try using `cmake` with the latest source-code from [GitHub](https://github.com/open-source-parsers/jsoncpp/). – cdunn2001 Feb 17 '15 at 01:14