0

I'm struggling with a Linker error in Xcode. I've created the amalgamated source, added the jsoncpp.cpp as a source file to my project, I've set the header search path to jsoncpp-master/dist and use

#include "json/json.h"
#include "json/json-forwards.h"

as described at https://github.com/open-source-parsers/jsoncpp. Still, I'm getting an undefined symbols error:

 Undefined symbols for architecture x86_64:
   "output(Json::Value)", referenced from:
      _main in main.o
 ld: symbol(s) not found for architecture x86_64
 clang: error: linker command failed with exit code 1 (use -v to see invocation)
user3515814
  • 957
  • 2
  • 8
  • 13
  • Did you add cpp files as described there? Can you post the exact error that you are seeing? – Sreekar Nov 20 '15 at 23:54
  • Are there other cpp files that I should be adding to the project? It says on "The recommended approach to integrating JsonCpp in your project is to include the amalgamated source (a single .cpp file and two .h files) in your project [...] The include/ path should be added to your compiler include path. Jsoncpp headers should be included as follow: #include ". However, later on it says that the amalgamated source is in dist/ and not in include/. So I added that one. I didn't want to add both since there is also a json/json.h in include/. I must be overlooking something.. @Sreekar – user3515814 Nov 21 '15 at 09:04

1 Answers1

0

I found that it works if json/json.h, json/json-forward.h and jsoncpp.cpp are copied to the project directory. jsoncpp.cpp is added as a source file and json/json.h as a header. However, NO additional header search paths are set.

user3515814
  • 957
  • 2
  • 8
  • 13