gnustep 在ubuntu 11.04下安装

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

sudo apt-get install gobjc

4. 测试程序

#import <stdio.h>
int main( int argc, const char *argv[] )
{
    printf( "hello world\n" );
    return 0;
}

然后执行编译:

gcc hello.m -o hello

如果调用到了 object-c的库, 以上编译命令会出错, 需要用下面命令:

gcc `gnustep-config --objc-flags` -lgnustep-base hello.m -o hello

然后允许代码看看

./hello

输入了

hello world

OK了


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值