1. $ yum -y install gcc-objc
2. 从下载GNUstep Startup和GNUstep Base,并从源码进行安装。
3.. $ export PATH=$PATH:/usr/GNUstep/System/Tools
4. $ echo "/usr/GNUstep/Local/Library/Libraries/" >> /etc/ld.so.conf
$ ldconfig
5.$ gcc `gnustep-config --objc-flags` -L/usr/GNUstep/Local/Library/Libraries -lgnustep-base hello.m -o hello
6. run program
prepare:
#yum install gcc-objc
#yum install libpng libpng-devel libtiff libtiff-devel libobjc libxml2 libxml2-devel libX11-devel libXt-devel libjpeg libjpeg-devel
#wget ftp://ftp.gnustep.org/pub/gnustep/core/gnustep-startup-0.25.0.tar.gz
#tar zxvf gnustep-startup-0.25.0.tar.gz
#cd gnustep-startup-0.25.0
#./configure
#make
#vi ~/.bashrc加入一行:
/usr/GNUstep/System/Library/Makefiles/GNUstep.sh
把/usr/GNUstep/Local/Library/Libraries/加到系统的lib路径里面
#vi /etc/ld.so.conf 加入下面一行:
/usr/GNUstep/Local/Library/Libraries/
编译环境配置好,写一个test.m并用下面的命令编译:
#gcc `gnustep-config --objc-flags` -L/usr/GNUstep/Local/Library/Libraries -lgnustep-base test.m -o test
#./test
正常的话会正确执行,如果有报“Unknown time zone name `CST'.”,请修改/etc/localtime 设置正确的系统时区
#vi /etc/localtime 清空之前的内容,加入下面的:
TZif2
UTC-8
阅读(1930) | 评论(0) | 转发(0) |