i386 体系结构的未定义符号
可能的重复:
找不到架构 i386 的符号
我有一个应用程序需要完成,当我开始尝试通过执行模拟器来了解以前的开发人员做了什么(我认为是使用 Xcode 3 完成的)时,Xcode 4 向我显示了 25 个问题:
Ld build/Debug-iphonesimulator/RadioPlayer.app/RadioPlayer normal i386
cd /Users/haithembenhammouda/Desktop/SonVidéo
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -L/Users/haithembenhammouda/Desktop/SonVidéo/build/Debug-iphonesimulator -L/Users/haithembenhammouda/Desktop/SonVidéo/Classes/RadioKitLib -L/Users/haithembenhammouda/Desktop/SonVidéo -F/Users/haithembenhammouda/Desktop/SonVidéo/build/Debug-iphonesimulator -filelist /Users/haithembenhammouda/Desktop/SonVidéo/build/SonVidéo.build/Debug-iphonesimulator/RadioPlayer.build/Objects-normal/i386/RadioPlayer.LinkFileList -mmacosx-version-min=10.6 -ObjC -Xlinker -objc_abi_version -Xlinker 2 -framework Foundation -framework UIKit -framework CoreGraphics -framework SystemConfiguration -framework MediaPlayer -framework CFNetwork -framework AudioToolbox -framework QuartzCore -lsqlite3.0 -framework AVFoundation -lRadioKit -framework MessageUI -o /Users/haithembenhammouda/Desktop/SonVidéo/build/Debug-iphonesimulator/RadioPlayer.app/RadioPlayer
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_RadioKit", referenced from:
objc-class-ref in RadioPlayerViewController.o
".objc_class_name_UIColor", referenced from:
pointer-to-literal-objc-class-name in libRadioKit.a(BufferView.o)
".objc_class_name_UIView", referenced from:
.objc_class_name_BufferView in libRadioKit.a(BufferView.o)
".objc_class_name_NSObject", referenced from:
.objc_class_name_ASE_Event in libRadioKit.a(ASE_Event.o)
.objc_class_name_AudioStreamEngine in libRadioKit.a(AudioStreamEngine.o)
.objc_class_name_RadioKit in libRadioKit.a(RadioKit.o)
.objc_class_name_XMLMetaParser in libRadioKit.a(XMLMetaParser.o)
".objc_class_name_NSDate", referenced from:
pointer-to-literal-objc-class-name in libRadioKit.a(AudioStreamEngine.o)
".objc_class_name_NSValue", referenced from:
pointer-to-literal-objc-class-name in libRadioKit.a(AudioStreamEngine.o)
".objc_class_name_NSScanner", referenced from:
pointer-to-literal-objc-class-name in libRadioKit.a(AudioStreamEngine.o)
".objc_class_name_NSCharacterSet", referenced from:
pointer-to-literal-objc-class-name in libRadioKit.a(AudioStreamEngine.o)
".objc_class_name_NSAutoreleasePool", referenced from:
pointer-to-literal-objc-class-name in libRadioKit.a(AudioStreamEngine.o)
pointer-to-literal-objc-class-name in libRadioKit.a(XMLMetaParser.o)
pointer-to-literal-objc-class-name in libRadioKit.a(reachability.o)
".objc_class_name_NSFileManager", referenced from:
pointer-to-literal-objc-class-name in libRadioKit.a(AudioStreamEngine.o)
".objc_class_name_NSURLConnection", referenced from:
pointer-to-literal-objc-class-name in libRadioKit.a(AudioStreamEngine.o)
pointer-to-literal-objc-class-name in libRadioKit.a(XMLMetaParser.o)
".objc_class_name_NSThread", referenced from:
pointer-to-literal-objc-class-name in libRadioKit.a(AudioStreamEngine.o)
.....(etc)
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
PS:我检查了框架,它们都存在。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
好吧,我为想要使用 xCode 4 的人找到了这个问题的解决方案。您所要做的就是从 SimulatorSDK 文件夹导入框架
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks
我不知道当您尝试在真实的 iDevice 上测试您的应用程序时它是否有效,但我确信它可以在模拟器上运行。
享受
well i found a solution to this problem for who want to work with xCode 4. All what you have to do is importing frameworks from the SimulatorSDK folder
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks
i don't know if it works when you try to test your app on a real iDevice, but i'm sure that it works on simulator.
ENJOY
虽然有点晚了,但对于遇到此错误的人来说可能很有价值。
我只是直接将一堆文件复制到 Xcode 项目中,如果您忘记将它们添加到项目构建阶段中,您将收到错误“未定义的符号”架构 i386”。因此,将您的实现文件添加到编译源,并将 Xib 文件添加到复制捆绑资源。
该错误告诉我,没有指向我的类的链接,只是因为它们没有包含在编译源中,这确实很明显,但可能会让人头痛。
A bit late to the party but might be valuable to someone with this error..
I just straight copied a bunch of files into an Xcode project, if you forget to add them to your projects Build Phases you will get the error "Undefined symbols for architecture i386". So add your implementation files to Compile Sources, and Xib files to Copy Bundle Resources.
The error was telling me that there was no link to my classes simply because they weren't included in the Compile Sources, quite obvious really but may save someone a headache.
在构建阶段的“链接二进制文件与库”列表中添加项目目标中使用的方法所需的框架,它将轻松工作。
导入到我的项目中一样
就像我已经将错误
Add the framework required for the method used in the project target in the "Link Binaries With Libraries" list of Build Phases, it will work easily.
Like I have imported to my project
For the bug
冒着听起来显而易见的风险,请务必检查前向类文件的拼写。有时,XCode(至少 XCode 4.3.2)会将声明变为绿色,而该声明实际上是驼峰式大小写错误的。就像这个例子一样:
如果 RadioKit 是一个类文件,并且您将其设置为另一个文件的属性,则在接口声明中,您可能会看到
“Radiokit”为绿色,而实际的声明应该是:
此错误也会抛出此类型的错误。另一个例子(就我而言)是,当您的通用应用程序的类名上有 _iPhone 和 _iphone 扩展名时。一旦我将相应的文件从 _iphone 更改为正确的 _iPhone,错误就消失了。
At the risk of sounding obvious, always check the spelling of your forward class files. Sometimes XCode (at least XCode 4.3.2) will turn a declaration green that's actually camel cased incorrectly. Like in this example:
If RadioKit was a class file and you make it a property of another file, in the interface declaration, you might see that
has "Radiokit" in green when the actual decalaration should be:
This error will also throw this type of error. Another example (in my case), is when you have _iPhone and _iphone extensions on your class names for universal apps. Once I changed the appropriate file from _iphone to the correct _iPhone, the errors went away.