简体   繁体   中英

Integrating jsoncpp by including amalgamated source in Xcode

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)

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM