linux compile objective-c

来源:互联网 发布:软件开发找对象 编辑:程序博客网 时间:2024/06/15 03:19
#import <Foundation/Foundation.h>int main (int argc, const char * argv[]){   NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];   NSLog (@"hello world");   [pool drain];   return 0;}
gcc `gnustep-config --objc-flags` -L/usr/GNUstep/System/Library/Libraries -lgnustep-base -lobjc *.m -o main

 gnustep-config --objc-flags                                                                                                                                                              -MMD -MP -DGNUSTEP -DGNUSTEP_BASE_LIBRARY=1 -DGNU_GUI_LIBRARY=1 -DGNU_RUNTIME=1 -DGNUSTEP_BASE_LIBRARY=1 -fno-strict-aliasing -fexceptions -fobjc-exceptions -D_NATIVE_OBJC_EXCEPTIONS -pthread -fPIC -Wall -DGSWARN -DGSDIAGNOSE -Wno-import -g -O2 -fgnu-runtime -fconstant-string-class=NSConstantString -fexec-charset=UTF-8 -I. -I/home/cg/root/GNUstep/Library/Headers -I/usr/GNUstep/Local/Library/Headers -I/usr/GNUstep/System/Library/Headers -I/usr/GNUstep/Local/Library/Headers -I/usr/GNUstep/Local/Library/Headers -I/usr/GNUstep/System/Library/Headers -I/usr/GNUstep/System/Library/Headers -I/usr/include/libxml2 -I/usr/include/p11-kit-1


0 0