为模拟器构建时出现此错误:
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_SA_OAuthTwitterEngine", referenced from:
objc-class-ref in NetworkUpdateViewController.o
"_OBJC_CLASS_$_SA_OAuthTwitterController", referenced from:
objc-class-ref in NetworkUpdateViewController.o
"_OBJC_CLASS_$_MGTwitterEngine", referenced from:
objc-class-ref in TwitterLoginViewController.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
在为本地设备(iPad)构建时:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_SA_OAuthTwitterController", referenced from:
objc-class-ref in NetworkUpdateViewController.o
"_OBJC_CLASS_$_SA_OAuthTwitterEngine", referenced from:
objc-class-ref in NetworkUpdateViewController.o
"_OBJC_CLASS_$_MGTwitterEngine", referenced from:
objc-class-ref in TwitterLoginViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
尝试了所有我能想到的...你能帮帮我吗?
Best Answer-推荐答案 strong>
Clang 非常擅长将错误放入人类可读的纯文本中,只是我们有时会放眼大局而放弃。看这里:
"_OBJC_CLASS_$_SA_OAuthTwitterController"
现在去掉标准的 _OBJC_CLASS_$ 部分,你会得到什么? SA_OAuthTwitterController 。
现在,第二部分:
... referenced from:
objc-class-ref in NetworkUpdateViewController.o
"_OBJC_CLASS_$_SA_OAuthTwitterEngine", referenced from:
objc-class-ref in NetworkUpdateViewController.o
"_OBJC_CLASS_$_MGTwitterEngine", referenced from:
objc-class-ref in TwitterLoginViewController.o
显然,您 引用这个不存在的标题 在 类命名:NetworkUpdateViewController 和 TwitterLoginView 。
现在,出现了两种可能性:要么是您没有将正确的文件添加到 Compile Sources 列表中,要么您碰巧使用了不是为 iOS 模拟器构建的框架(架构 i386)(或通用库,因为它们通常被称为)。在第一种情况下,找到有问题的实现文件并将它们拖到 Compile Sources 列表中,然后构建并运行。如果是第二种情况,那么您必须在设备上进行测试,或者尝试将 lib 重新编译为可用的通用库,这比听起来更难。
关于ios - 体系结构 i386 链接命令退出代码 1 的 undefined symbol ,我们在Stack Overflow上找到一个类似的问题:
https://stackoverflow.com/questions/11487545/
|