ubuntu搭建object-c环境
来源:互联网 发布:传奇胖妞赌大小数据 编辑:程序博客网 时间:2024/05/17 01:28
环境:ubuntu 10.0.4
Ubuntu下Object-c的开发环境搭建:
1.安装gnustep和gobjc
sudo apt-get install gobjc gnustep gnustep-devel
失败报错缺少依赖关系grom.app
需要升级一下
2.Hello World
#import <Foundation/Foundation.h>
int main(int argc, const char *argv[]) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSLog(@"Hello world\n");
[pool drain];
return 0;
}
3.环境设置
hello.m:1: fatal error: Foundation/Foundation.h: 没有那个文件或目录
compilation terminated.
4.gcc `gnustep-config --objc-flags` hello.m -o hello
/tmp/ccrmAs5F.o: In function `main':
/home/shaochangqing/study/hello.m:3: undefined reference to `objc_get_class'
/home/shaochangqing/study/hello.m:3: undefined reference to `objc_msg_lookup'
/home/shaochangqing/study/hello.m:3: undefined reference to `objc_msg_lookup'
/home/shaochangqing/study/hello.m:4: undefined reference to `NSLog'
/home/shaochangqing/study/hello.m:5: undefined reference to `objc_msg_lookup'
/tmp/ccrmAs5F.o: In function `__objc_gnu_init':
/home/shaochangqing/study/hello.m:7: undefined reference to `__objc_exec_class'
/tmp/ccrmAs5F.o:(.data.rel+0x0): undefined reference to `__objc_class_name_NSAutoreleasePool'
/tmp/ccrmAs5F.o:(.data.rel+0x8): undefined reference to `__objc_class_name_NSConstantString'
collect2: ld returned 1 exit status
5.链接库
gcc `gnustep-config --objc-flags` -lgnustep-base hello.m -o hello
注意不是单引号
6.Run It
2012-05-13 13:59:05.650 hello[6374] Hello world
- ubuntu搭建object-c环境
- Ubuntu下Object-C开发环境搭建
- Ubuntu下Object-C开发环境搭建
- object-c ubuntu下开发环境搭建
- GNUstep搭建Object-C开发环境-debian, ubuntu
- 在ubuntu上搭建object c
- Windows下搭建Object-C环境
- Windows下搭建Object-C开发环境
- Object-C学习之一:开发环境搭建
- Windows下搭建Object-C环境
- Ubuntu下安装Object-C 环境
- ubuntu下配置object c开发环境
- ubuntu C开发环境搭建
- Windows环境下面搭建Object C开发环境
- 如何在Windows环境搭建Object C开发环境
- 在Windows环境搭建Object C开发环境
- ubuntu 8.04 C/C++开发环境搭建
- ubuntu下的c c++环境搭建
- 另一个HookAPI 源码,来自EurekaLog for Delphi中的EHook.pas
- TestDirector8.0 下载 安装
- 接口对接
- 268. Like father, like son. 有其父,必有其子
- 关于URL优化的一些经验
- ubuntu搭建object-c环境
- 一位码农的人生自述(十二)------高中(终)
- Ubuntu 12.04 改造指南
- BI与ERP 谁先谁后?
- NYOJ 325 zb的生日(搜索解平分问题)
- 目前 Google 的创新精神是否超过了苹果?
- 我的2012,一个2b青年的表白
- IIS 7 托管管道模式 经典模式(Classic) 集成模式(Integrated) 分析与理解
- wordpress博客 qq客服插件