Search code examples
c++xcodexcode5setup-projectjsoncpp

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


Solution

  • 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".