简体   繁体   中英

Why do I get an Apple Mach-O Linker (ID) Error?

I know that this question had been asked many times, but every answer seems different. I have built my project and tried to run it, but I get this error:

Ld "/Users/******/Library/Developer/Xcode/DerivedData/Cypher_Bot-dxylepzskcnrtybprtuaotmycjjo/Build/Products/Debug-iphonesimulator/Cypher Bot.app/Cypher Bot" normal i386
cd "/Users/******/Xcode/iOS/Cypher Bot/Universal/Cypher Bot/Cypher Bot"
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/clang -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -L/Users/********/Library/Developer/Xcode/DerivedData/Cypher_Bot-dxylepzskcnrtybprtuaotmycjjo/Build/Products/Debug-iphonesimulator -F/Users/**********/Library/Developer/Xcode/DerivedData/Cypher_Bot-dxylepzskcnrtybprtuaotmycjjo/Build/Products/Debug-iphonesimulator -filelist "/Users/*******/Library/Developer/Xcode/DerivedData/Cypher_Bot-dxylepzskcnrtybprtuaotmycjjo/Build/Intermediates/Cypher Bot.build/Debug-iphonesimulator/Cypher Bot.build/Objects-normal/i386/Cypher Bot.LinkFileList" -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -framework Security -framework UIKit -framework Foundation -framework CoreGraphics -framework CoreData -o "/Users/********/Library/Developer/Xcode/DerivedData/Cypher_Bot-dxylepzskcnrtybprtuaotmycjjo/Build/Products/Debug-iphonesimulator/Cypher Bot.app/Cypher Bot"

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_MFMailComposeViewController", referenced from:
  objc-class-ref in CryptoMainViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I also get this right below the message above:

错误

What does this mean? What do I do to fix it?

The error means that the linker can't find the class definition for MFMailComposeViewController . That class is defined in the MessageUI framework. Did you add the MessageUI framework to your target? If you don't know how to do that, read this: How to "add existing frameworks" in Xcode 4?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM