I'm very new to xcode and c++ programming so please let me know if I'm going about this all wrong. Basically, I want to create a C++ project that requires a library to deal with making and receiving json calls. (this will eventually be integrating as the 'engine' of an iOs and android app.) I want to use xcode to create this and I tried installing libjson but couldn't get it to recognize. I then tried using JsonCpp and followed the instruction.
1) I downloaded the tar.gz 2) I downloaded the scons python program and in the jsoncpp folder and ran the appropriate command (something like 'python scons.py platform=linux-gcc check')
This created a .a and a .dylib file
Next, i tried to move the files into the project and link it in xcode from 'Link Binary With Libraries' portion of the Build Phases tab in the project settings.
I linked up the code to my file with an include statement: #include "lib/jsoncpp/json.h"
This led to the following error:
Undefined symbols for architecture x86_64: "Json::Reader::parse(std::__1::basic_string, std::__1::allocator > const&, Json::Value&, bool)", referenced from: jsonParser::parseLogin(std::__1::basic_string, std::__1::allocator >&, std::__1::basic_string, std::__1::allocator >&) in jsonParser.o ld: symbol(s) not found for architecture x86_64
(null): "Json::Reader::parse(std::__1::basic_string, std::__1::allocator > const&, Json::Value&, bool)", referenced from:
All I am trying to do is set up this library but It has been keeping me from working on my code for the past day looking for a solution.
For the libjson library, I tried following the directions here but with similar issues: Cannot Install libjson in c++ Embedding in XCode 4 Project
Does anyone have any advice on steps I can take to set this up? Thank you for your time.
In the end, I tried just copying the entire source project into my xcode project and building it. it ended up solving the issue.
This is How I solved the issue: