sudo pacman -S gcc-objc
sudo pacman -S gnustep-base gunstep-make
// test.m
#import <Foundation/Foundation.h>
int main(int argc,const char * argv[]){
//你应该使用pool,不然输出格式很乱
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc]init];
NSLog(@"this is a string");
[pool drain];
return 0;
}
编译
gcc `gnustep-config --objc-flags` -lgnustep-base -lobjc test.m -o test