确保系统已经安装了gcc和make,如果没有请自行先安装

按下面的步骤进行安装:

#yuminstallgcc-objc

#yuminstalllibpnglibpng-devellibtifflibtiff-devellibobjclibxml2libxml2-devellibX11-devellibXt-devellibjpeglibjpeg-devel

#wgetftp://ftp.gnustep.org/pub/gnustep/core/gnustep-startup-0.25.0.tar.gz

#tarzxvfgnustep-startup-0.25.0.tar.gz

#cdgnustep-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-basetest.m-otest

#./test

正常的话会正确执行,如果有报“Unknowntimezonename`CST'.”,请修改/etc/localtime设置正确的系统时区

#vi/etc/localtime清空之前的内容,加入下面的:

TZif2

UTC-8