3


我一直在开发一个应用程序,用于将照片图像从 iPhone 上传到网络服务器进行实习,但每次尝试运行该应用程序时,都会出现 Mach-O 链接器错误。我已经尝试了在此站点上找到的所有内容(重新创建应用程序、添加 libz.dylib、添加 QuartzCore.Framework),但错误仍然存​​在。有人知道代码有什么问题吗?

错误

Undefined symbols for architecture x86_64:<br>
"_compress", referenced from:<br>
 -[Uploader(Private) compress:] in AppDelegate.o<br>
ld: symbol(s) not found for architecture x86_64<br>
clang: error: linker command failed with exit code 1 (use -v to see invocation)<br>

Ld /Users/AppleStoreStaples/Library/Developer/Xcode/DerivedData/PhotoUploader-bafqzogdtrxrvdgesppeismhxrkf/Build/Products/Debug/PhotoUploader.app/Contents/MacOS/PhotoUploader normal x86_64
cd /Users/AppleStoreStaples/Documents/Projects/PhotoUploader
setenv MACOSX_DEPLOYMENT_TARGET 10.7
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -L/Users/AppleStoreStaples/Library/Developer/Xcode/DerivedData/PhotoUploader-bafqzogdtrxrvdgesppeismhxrkf/Build/Products/Debug -F/Users/AppleStoreStaples/Library/Developer/Xcode/DerivedData/PhotoUploader-bafqzogdtrxrvdgesppeismhxrkf/Build/Products/Debug -filelist /Users/AppleStoreStaples/Library/Developer/Xcode/DerivedData/PhotoUploader-bafqzogdtrxrvdgesppeismhxrkf/Build/Intermediates/PhotoUploader.build/Debug/PhotoUploader.build/Objects-normal/x86_64/PhotoUploader.LinkFileList -mmacosx-version-min=10.7 -fobjc-link-runtime -framework QuartzCore -framework Cocoa -o /Users/AppleStoreStaples/Library/Developer/Xcode/DerivedData/PhotoUploader-bafqzogdtrxrvdgesppeismhxrkf/Build/Products/Debug/PhotoUploader.app/Contents/MacOS/PhotoUploader
4

1 回答 1

2

您的AppDelegate文件包含一个名为Uploader (Private). 它定义了一个名为 的方法compress:,该方法使用了一个名为 的函数compress()。您还没有将实现该compress()功能的任何东西链接到应用程序二进制文件中。

于 2012-11-13T09:55:38.253 回答