我一直在开发一个应用程序,将照片图像从iPhone上传到网络服务器进行实习,但是每次尝试运行该应用程序时,都会收到Mach-O Linker Error。
我已经尝试了在此站点上找到的所有内容(重新创建应用程序,添加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

最佳答案

您的AppDelegate文件包含一个名为Uploader (Private)的类别。它定义了一个名为compress:的方法,该方法使用了一个名为compress()的函数。您尚未将实现compress()功能的任何内容链接到应用程序二进制文件中。

关于iphone - Apple Mach-O链接器(ID)错误_compress和链接器命令失败,退出代码为1,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/13358551/

10-10 01:17