GnuStep使用

gcc -o main main1.m -I/GNUstep/System/Library/Headers -fconstant-string-class=NSConstantString -L/GNUstep/System/Library/Libraries -lobjc -lgnustep-base


1、cd /home

2、gcc -o helloworld helloworld.m -I/GNUstep/System/Library/Headers -fconstant-string-class=NSConstantString -L/GNUstep/System/Library/Libraries -lobjc -lgnustep-base

3、运行helloworld.exe

说明:第二步中的一些参数明说,如果熟悉Linux/Unix下C/C++编译的话,上述参数应该很熟悉,-I表示头文件查找的路径,-L表示库文件查找路径,-l表示需要链接的库文件。但是,-fconstant-string-class=NSConstantString 对于这个参数可能比较陌生,这个参数主要是指定常量字符串所使用的class。

helloworld.exe编译并运行成功的话,说明windows下Objective C开发环境就搭建好了,这样就可以开始以廉价方式的学习Objective C。:)

gcc -o a a.m -I/GNUstep/System/Library/Headers -fconstant-string-class=NSConstantString -L/GNUstep/System/Library/Libraries -lobjc -lgnustep-base

原文地址:https://www.cnblogs.com/ly123456/p/6070353.html