简体   繁体   English

通过在Xcode中包含合并的源代码来集成jsoncpp

[英]Integrating jsoncpp by including amalgamated source in Xcode

I'm struggling with a Linker error in Xcode. 我在Xcode中遇到Linker错误。 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 我创建了合并后的源,将jsoncpp.cpp作为源文件添加到了我的项目中,将标头搜索路径设置为jsoncpp-master / dist并使用

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

as described at https://github.com/open-source-parsers/jsoncpp . 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. 我发现,如果将json / json.h,json / json-forward.h和jsoncpp.cpp复制到项目目录中,它将起作用。 jsoncpp.cpp is added as a source file and json/json.h as a header. 将jsoncpp.cpp添加为源文件,将json / json.h添加为头文件。 However, NO additional header search paths are set. 但是,没有设置其他标题搜索路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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