i386 体系结构的未定义符号

发布于 2024-11-19 01:32:17 字数 3692 浏览 3 评论 0 原文

可能的重复:
找不到架构 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:我检查了框架,它们都存在。

Possible Duplicate:
symbol(s) not found for architecture i386

I have an app to complete, and when I start trying to understand what the previous developer did (it was done with Xcode 3 I think) by executing the simulator, Xcode 4 show me 25 issues:

    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: I checked frameworks and all of them exist.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

万水千山粽是情ミ 2024-11-26 01:32:18

好吧,我为想要使用 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

深海里的那抹蓝 2024-11-26 01:32:17

虽然有点晚了,但对于遇到此错误的人来说可能很有价值。

我只是直接将一堆文件复制到 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.

紫轩蝶泪 2024-11-26 01:32:17

在构建阶段的“链接二进制文件与库”列表中添加项目目标中使用的方法所需的框架,它将轻松工作。
导入到我的项目中一样

QuartzCore.framework

就像我已经将错误

架构 i386 的未定义符号:

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

QuartzCore.framework

For the bug

Undefined symbols for architecture i386:

旧瑾黎汐 2024-11-26 01:32:17

冒着听起来显而易见的风险,请务必检查前向类文件的拼写。有时,XCode(至少 XCode 4.3.2)会将声明变为绿色,而该声明实际上是驼峰式大小写错误的。就像这个例子一样:

"_OBJC_CLASS_$_RadioKit", referenced from:
  objc-class-ref in RadioPlayerViewController.o

如果 RadioKit 是一个类文件,并且您将其设置为另一个文件的属性,则在接口声明中,您可能会看到

Radiokit *rk;

“Radiokit”为绿色,而实际的声明应该是:

RadioKit *rk;

此错误也会抛出此类型的错误。另一个例子(就我而言)是,当您的通用应用程序的类名上有 _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:

"_OBJC_CLASS_$_RadioKit", referenced from:
  objc-class-ref in RadioPlayerViewController.o

If RadioKit was a class file and you make it a property of another file, in the interface declaration, you might see that

Radiokit *rk;

has "Radiokit" in green when the actual decalaration should be:

RadioKit *rk;

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文