[英]Xcode project build: Failed
我正在開發簡單的應用程序,並且在編寫代碼時沒有錯誤,但是當我按下構建按鈕時,就發生了錯誤。 生成myProject:失敗,並且xCode向我顯示兩個錯誤警告。 錯誤消息如下:
Ld /Users/MacUser/Library/Developer/Xcode/DerivedData/Calculator-azorstixlscpikfhurtxwvvwachh/Build/Products/Debug-iphonesimulator/Calculator.app/Calculator normal i386
cd "/Users/MacUser/Downloads/Downloads/Desktop/old drop box/calc/Calculator"
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk
-L/Users/MacUser/Library/Developer/Xcode/DerivedData/Calculator-azorstixlscpikfhurtxwvvwachh/Build/Products/Debug-iphonesimulator
-F/Users/MacUser/Library/Developer/Xcode/DerivedData/Calculator-azorstixlscpikfhurtxwvvwachh/Build/Products/Debug-iphonesimulator
-filelist /Users/MacUser/Library/Developer/Xcode/DerivedData/Calculator-azorstixlscpikfhurtxwvvwachh/Build/Intermediates/Calculator.build/Debug-iphonesimulator/Calculator.build/Objects-normal/i386/Calculator.LinkFileList
-mmacosx-version-min=10.6 -Xlinker
-objc_abi_version -Xlinker 2
-fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50100
-framework UIKit -framework Foundation -framework CoreGraphics
-o /Users/MacUser/Library/Developer/Xcode/DerivedData/Calculator-azorstixlscpikfhurtxwvvwachh/Build/Products/Debug-iphonesimulator/Calculator.app/Calculator
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_AxesDrawer", referenced from:
objc-class-ref in AxesView.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我發現了一些東西,這是我的controller.m代碼:
#import "AxesView.h"
#import "AxesDrawer.h"
@implementation AxesView
- (void)drawRect:(CGRect)rect
{
CGRect b;
b = self.bounds;
CGPoint aO;
aO = b.origin;
CGFloat pPU;
pPU = b.size.height;
[AxesDrawer drawAxesInRect:(CGRect)b originAtPoint:(CGPoint)aO scale:(CGFloat)pPU];
}
@end
我在AxesDrawer.h文件中認為的問題,但我不知道為什么。 如果我將導入從AxesDrawer.h更改為AxesDrawer.m(我知道這是錯誤的,但僅用於測試),則該項目將在模擬器中構建並運行。 有人可以幫我嗎? 我做錯了什么?
AxesDrawer.m可能不在您的目標中。 單擊它並使用最右邊的“實用程序”面板,並確保已檢查要構建的目標。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.