【发布时间】:2011-10-18 18:18:25
【问题描述】:
我正在使用 TextMate 做一些 Objective-C 练习。当所有内容都在一个文件中时,它可以正常工作,但是一旦我想使用多个文件,它就会出错。比如我有一个单独的Rectangle.h文件要导入:
#import "Rectangle.h"
int main (int argc, char *argv[]) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
Rectangle *rectangle = [[Rectangle alloc] init];
[pool drain];
return 0;
}
运行报此错误:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_Rectangle", referenced from:
objc-class-ref in ccccStDD.o
ld: symbol(s) not found for architecture x86_64
我正在使用 C 包的“运行”命令。使用 Xcode 包的“Build & Run”命令会给我一个不同的错误。
如何让 TextMate 导入我的 Rectangle.h 文件并运行?
【问题讨论】:
标签: objective-c macos import textmate file-management