0

シンプルなアプリで作業していて、コードを書いている間はエラーはありませんが、ビルドボタンを押すとエラーが発生します。myProjectのビルド:失敗しました。xCodeは2つのエラー警告を表示します。ここにエラーメッセージがあります:

 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に変更すると(これは間違っていることはわかっていますが、テスト用です)、プロジェクトはシミュレーターでビルドおよび動作します。誰かがこれを手伝ってくれますか?私が間違ったことは何ですか?

4

1 に答える 1

3

AxesDrawer.m はおそらくターゲットに含まれていません。それをクリックし、右端の [ユーティリティ] パネルを使用して、ビルドしているターゲットがチェックされていることを確認します。

于 2012-08-05T12:43:10.097 に答える