fedora19安装objected-c环境


  GNUSTEP_MAKEFILES=/usr/lib64/GNUstep/Makefiles
  export GNUSTEP_MAKEFILES


#import <Foundation/Foundation.h>

int main(int argc, char * argv[]){
    NSLog(@"Hello world!\n");
    return 0;
}
 gcc `gnustep-config --objc-flags` -L/lib64/libobjc.so.4   -lgnustep-base  hello.m -o hello
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.8.2/../../../../lib64/libgnustep-base.so: undefined reference to symbol 'objc_msg_lookup'
/usr/bin/ld: note: 'objc_msg_lookup' is defined in DSO /lib64/libobjc.so.4 so try adding it to the linker command line
/lib64/libobjc.so.4: could not read symbols: 无效的操作
collect2: 错误:ld 返回 1

--------------------------------------------------------------------------------------------------------------------------

$gcc hello.m `gnustep-config --objc-flags` -lobjc -lgnustep-base -o hello
$ ./hello
2013-11-18 22:16:42.869 hello[8531] Hello,world!

参考:

http://stackoverflow.com/questions/13446450/simple-hello-world-in-objective-c-with-clang-and-gnustep-does-not-compile

转载于:https://my.oschina.net/luyuhx/blog/177312

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值