http://www.techotopia.com/index.php/Building_and_Installing_GNUstep_on_Linux
http://blog.csdn.net/reddream228/article/details/6588032
上面兩篇應該都可以。
我是按照第一篇來的,期間遇到問題如下:
第一個錯誤:
E127 Error
No X11 libraries/headers were found for compiling GNUstep GUI. You may
have X11 installed, but not the developer packages, which are required
for compiling anything that uses X. If you are using Debian, or a similar
packaged system, try looking for help on installing developer or -dev
packages for the X11 system.
是缺少相應的安裝包:
http://pkgs.info/ 一個可以查linux安裝包的網站。
yum install libXt-devel
然后其他缺少的:
yum install gnutls-devel
yum install libicu-devel
yum install libjpeg libjpeg-devel
安裝成功以后的提示:
Now run the GNUstep initialization script (put this in your
.bashrc or other type of startup script). Note the '.' at the
beginning of the line.
. /usr/GNUstep/System/Library/Makefiles/GNUstep.sh
Now you can install some applications and start using GNUstep
Look for a few applications in the AppSources directory. The
typical way to install an application is:
tar -zxf MyApplication.tar.gz
cd MyApplication
make
make install (as root, unless GNUstep is in your home dir)
Then start the application:
openapp MyApplication.app
但是編譯的時候一直不對,折騰了好久才發現第一篇安裝說明里的路徑錯誤了。
因該是:
gcc
gnustep-config --objc-flags
-L/usr/GNUstep/System/Library/Libraries -lgnustep-base hello.m -o hello
也可能是版本不同導致的。
我安裝的最新的0.30
下面這個命令也可以編譯成功的。
gcc -o helloworld helloworld.m -I/GNUstep/System/Library/Headers -fconstant-string-class=NSConstantString -L/GNUstep/System/Library/Libraries -lobjc -lgnustep-base
之前在windows下一直編譯不通過應該也是路徑錯了。