未找到 RKJSONParserJSONKit
我正在尝试使用 RestKit 的 JSON 解析,但我收到了 以下编译时错误:
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_RKJSONParserJSONKit", referenced from:
objc-class-ref in FloorMapLoaderViewController.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
RestKit 工作正常,这是迄今为止我见过的唯一错误。 这是我的导入行:
#import <RestKit/Support/JSON/JSONKit/RKJSONParserJSONKit.h>
编辑: 奇怪的是,只有当我尝试创建一个解析器时,它才无法编译,如下所示:
RKJSONParserJSONKit *parser = [RKJSONParserJSONKit new];
注释掉这一行允许编译,但我确实需要实例化一个解析器。
我该如何修复这个错误? 谢谢。
I'm trying to use JSON parsing from RestKit, but I'm receiving
the following compile time error:
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_RKJSONParserJSONKit", referenced from:
objc-class-ref in FloorMapLoaderViewController.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
RestKit works ok, this being the only error I've seen so far.
This is my import line:
#import <RestKit/Support/JSON/JSONKit/RKJSONParserJSONKit.h>
edit:
oddly, it fails to compile only if I try to create a parser like so:
RKJSONParserJSONKit *parser = [RKJSONParserJSONKit new];
Commenting out this line allows for compilation, but I do need to instance a parser.
How can I fix this error?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
导入意味着您的源代码可以看到 API,因此 IDE 知道如何自动完成,以便编译器知道如何生成正确的目标代码。
您有链接器错误。一旦编译了您自己的代码,它就必须与其依赖的所有代码捆绑在一起(不包括动态链接的系统库)。您的链接器告诉您,将它能找到的所有内容捆绑在一起后,并非所有内容都在那里。
您需要做的是转到您正在构建的目标,选择“构建阶段”选项卡,然后将必要的库添加到“链接二进制文件与库”部分。
Importing means that your source code can see the API, so the IDE knows how to auto-complete and so that the compiler knows how to generate the right object code.
You have a linker error. Once your own code is compiled, it has to all be bundled together with all the code it is dependent on (not counting dynamically linked system libraries). Your linker is telling you that after bundled everything it can find together, not all of it is there.
What you need to do is go to the target you are building, select the Build Phases tab, and add the necessary library to the "Link Binary With Libraries" section.