1. 在软件中心安装 gnustep
2.
#echo'export LIBRARY_PATH=/usr/lib/GNUstep/System/Library/Libraries' >>~/.profile
2#echo'export OBJC_INCLUDE_PATH=/usr/include/GNUstep/Headers' >>~/.profile
3#source~/.profile
然后执行GNUstep.sh的脚本,自动加载其他环境PATH:
1#chmod+x/usr/share/GNUstep/Makefiles/GNUstep.sh
2#source/usr/share/GNUstep/Makefiles/GNUstep.sh
也加入.profile文件,以便用户登陆系统时加载
1#echo'source /usr/share/GNUstep/Makefiles/GNUstep.sh' >>~/.profile

3.安装gobjc

sudoapt-get install gobjc

4.测试程序

 #import  int main( int argc, const char *argv[] ) { printf( "hello world\n" ); return 0; }
 
 
 gcc -o hello hello.m -l objc

11-15 14:48