Search code examples
c++xcoderapidjson

How to update rapidjson in Xcode 5.1.1


The rapidjson build within Xcode 5.1.1 is already old. I found the FileStream class which is already deprecated and there is no FileReadStream.

Anyone know How to update rapidjson in Xcode 5.1.1?


Solution

  • rapidjson is a header only library, you should be able to just grab the latest version from the rapidjson git repository and place the files in your project/system's include path.

    Note that this repository is in active development and I don't see any official stable releases yet, so you may also want to check out its old home at google code. This is discussed in this issue on the github repo.

    I'm not sure about updating the libraries that come with Xcode specifically. You should be fine with just adding the rapidjson header files somewhere on your machine - either with the rest of your include files or in a directory which you specify to GCC as being an include directory using the -I(include directory here) command line option.

    For example:

    -I"external/includes" if you place the rapidjson files in the relative directory external/includes/rapidjson and use #include <rapidjson/(rapidjson file name)> when including a rapidjson file.

    If you do either of those GCC will look there before looking in the system include paths (where XCode most likely installed rapidjson), and use the newer files you provided. I don't have any personal experience with LLVM, but I'd assume they would handle include files the same way (though the command line option may be different).