次のObjective-CプログラムをUbuntuHardyでコンパイルしようとしていますが、何らかの理由で警告が表示されます。
#import <Foundation/Foundation.h>
int main (int argc, char *argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSLog (@"Hello");
[pool drain];
return 0;
}
コンパイラの出力:
$ gcc `gnustep-config --objc-flags` -lgnustep-base objc.m
This is gnustep-make 2.0.2. Type 'make print-gnustep-make-help' for help.
Making all for tool LogTest...
Compiling file objc.m ...
objc.m: In function ‘main’:
objc.m:6: warning: ‘NSAutoreleasePool’ may not respond to ‘-drain’
objc.m:6: warning: (Messages without a matching method signature
objc.m:6: warning: will be assumed to return ‘id’ and accept
objc.m:6: warning: ‘...’ as arguments.)
Linking tool LogTest ...
実行結果は次のとおりです。
$ ./a.out
2009-06-28 21:38:00.063 a.out[13341] Hello
Aborted
終わったよ:
apt-get install build-essential gnustep gobjc gnustep-make libgnustep-base-dev
この問題を解決するにはどうすればよいですか?