2012-08-05 158 views
0

我正在处理简单的应用程序,并且在编写代码时没有错误,但是当我推送生成按钮时,发生错误。构建myProject:失败,xCode向我显示两条错误警告。这里的错误消息: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(我知道这是错误的,但仅用于测试) 该项目将建立并在模拟器中工作。有人可以帮助我吗?我做错了什么?

回答

3

AxesDrawer.m可能不在您的目标中。点击它并使用最右侧的工具面板,并确保检查了您正在构建的目标。

+0

你是对的,谢谢,我是iOS开发新手。谢谢。 – user748634 2012-08-05 12:54:29