Question


I have been working on an app to upload photo images from an iPhone to a web server for internship, but every time I try to run the app, I get a Mach-O Linker Error. I have tried everything I found on this site (recreating the app, add libz.dylib, add QuartzCore.Framework), but the errors still remain. Anyone know what's wrong with the code?

Error

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
Was it helpful?

Solution

Your AppDelegate file includes a category called Uploader (Private). It defines a method called compress:, which uses a function called compress(). You haven't linked whatever implements the compress() function into the app binary.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top