我在 Ubuntu 12 上。
我正在尝试使用 clang 编译一个 Objective-C hello_world 应用程序。这是来源:
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSLog (@"hello world");
[pool drain];
return 0;
}
我使用这个命令行:
. /usr/share/GNUstep/Makefiles/GNUstep.sh
clang h.m `gnustep-config --objc-flags` -lgnustep-base -o hello
我收到以下错误:
clang: warning: argument unused during compilation: '--param ssp-buffer-size=4'
In file included from h.m:1:
In file included from /usr/include/GNUstep/Foundation/Foundation.h:30:
In file included from /usr/include/GNUstep/GNUstepBase/GSVersionMacros.h:193:
In file included from /usr/include/GNUstep/GNUstepBase/GSConfig.h:229:
/usr/include/GNUstep/GNUstepBase/preface.h:112:11: fatal error: 'objc/objc.h'
file not found
#include <objc/objc.h>
^
1 error generated.
使用 gcc 的相同命令行可以正常工作。
任何想法如何解决这个丢失的 objc.h 错误?