Objective-c学习笔记—— Ubuntu 环境搭建 + HelloWorld
来源:互联网 发布:京都特色民宿酒店知乎 编辑:程序博客网 时间:2024/04/30 04:18
一直想学习IOS手机开发,今天开始涉入该领域。好吧,先从基础开始——搭建开发环境。
系统: Ubuntu 12.04 LTS 64 位
环境搭建步骤:
1、安装编译器
sudo apt-get install gnustep*
2、配置环境变量
# set GNUstepGNUSTEP_ROOT=/usr/share/GNUstep/Makefilesexport GNUSTEP_ROOTsource /usr/share/GNUstep/Makefiles/GNUstep.sh
3、编写HelloWorld测试安装环境 hello.m
#import <Foundation/Foundation.h>int main(int argc , const char * argv[]){ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSLog(@"Hello World! \n"); [pool drain]; return 0;}
4、编写GNUMakefile文件(和hello.m文件放同一个目录)
include $(GNUSTEP_ROOT)/common.makeTOOL_NAME = HelloWorldHelloWorld_OBJC_FILES = hello.minclude $(GNUSTEP_ROOT)/tool.make
记得GNUSTEP_ROOT和环境变量中设置的一致。
make
在obj目录下有个可执行文件HelloWorld , 执行该文件输出:
./obj/HelloWorld2014-05-04 07:07:35.340 HelloWorld[15727] Hello World!
以下内容于2014-6-20 添加
1、 修正上述步骤中GNUmakefile 的命名 , 注意是GNUmakefile 而不是 GNUMakefile 。
2、 在新的ubuntu系统(ubuntu 10.04)中 出现以下错误
The following packages have unmet dependencies: gnustep-devel: Depends: gorm.app but it is not installable gnustep-dl2: Depends: gorm.app but it is not installable libgnustep-gui-dev: Depends: libpng12-dev but it is not going to be installed Depends: libtiff4-dev but it is not going to be installed or libtiff-dev
解决方法:
sudo apt-get install gorm.app
The following packages have unmet dependencies: gnustep-back-common: Breaks: gnustep-back-doc (< 0.18.0-2) libgnustep-base1.19-dbg: Depends: gnustep-base-runtime (= 1.19.3-1ubuntu1) but 1.20.1-6 is to be installed libgnustep-base1.20-dbg: Conflicts: libgnustep-base1.19-dbg but 1.19.3-1ubuntu1 is to be installed libgnustep-gui0.16-dbg: Depends: gnustep-gui-runtime (= 0.16.0-2build1) but 0.18.0-5 is to be installed libgnustep-gui0.18-dbg: Conflicts: libgnustep-gui0.16-dbg but 0.16.0-2build1 is to be installedE: Broken packages
解决方法:
sudo apt-get purge libgnustep-base1.20-dbgsudo apt-get purge libgnustep-gui0.18-dbgsudo apt-get install libgnustep-gui0.18-dbg libgnustep-base1.20-dbg
0 0
- Objective-c学习笔记—— Ubuntu 环境搭建 + HelloWorld
- 如何在Ubuntu系统里搭建Objective C学习环境
- Objective-C学习笔记(二)-HelloWorld
- Objective-C 学习笔记:从HelloWorld开始
- Ubuntu下Objective-C开发环境搭建
- Ubuntu/Kubuntu Objective-C 开发环境搭建
- Ubuntu下搭建Objective-C开发环境
- Ubuntu下Objective-C开发环境搭建
- 01_Android学习笔记——环境的搭建之Helloworld运行原理
- 1. 笔记JAVA框架学习——Spring入门环境搭建及helloworld
- Windows下搭建Objective-C学习环境
- objective-c 学习第一节 HelloWorld
- Objective-C环境搭建
- 如何在ubuntu下搭建Objective-C开发环境
- 在Ubuntu 10.04中搭建Objective-C 开发环境
- 在Ubuntu 10.04中搭建Objective-C 开发环境
- Ubuntu/Kubuntu Objective-C 开发环境搭建 (续)
- 在 Ubuntu 中使用 GNUstep 搭建 Objective-C 开发环境
- GameObject和gameobject之间的区别
- 打开个人数据库
- boost::serialization 拆分serialize函数
- UVa 11234 - Expressions
- 七种角度分析对应分析方法
- Objective-c学习笔记—— Ubuntu 环境搭建 + HelloWorld
- error C2146: 语法错误 : 缺少“;”(在标识符“RGB2Gray”的前面)
- 面试题 自己实现strcpy 函数
- 11.C语言泛型的支持
- 街道问题_DP
- 【操作系统】进程调度算法
- HDU 2802 F(N) (找循环节)
- windows编程->线程函数
- 友情链接交换中的小花招-SEO搜索引擎优化