繁体   English   中英

Xcode项目构建:失败

[英]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.

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