Objective-c学习笔记—— Ubuntu 环境搭建 + HelloWorld
2014-05-04 22:11
495 查看
一直想学习IOS手机开发,今天开始涉入该领域。好吧,先从基础开始——搭建开发环境。
系统: Ubuntu 12.04 LTS 64 位
环境搭建步骤:
1、安装编译器
2、配置环境变量
3、编写HelloWorld测试安装环境 hello.m
4、编写GNUMakefile文件(和hello.m文件放同一个目录)
记得GNUSTEP_ROOT和环境变量中设置的一致。
make
在obj目录下有个可执行文件HelloWorld , 执行该文件输出:
以下内容于2014-6-20 添加
1、 修正上述步骤中GNUmakefile 的命名 , 注意是GNUmakefile 而不是 GNUMakefile 。
2、 在新的ubuntu系统(ubuntu 10.04)中 出现以下错误
解决方法:
解决方法:
系统: Ubuntu 12.04 LTS 64 位
环境搭建步骤:
1、安装编译器
sudo apt-get install gnustep*
2、配置环境变量
# set GNUstep GNUSTEP_ROOT=/usr/share/GNUstep/Makefiles export GNUSTEP_ROOT source /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.make TOOL_NAME = HelloWorld HelloWorld_OBJC_FILES = hello.m include $(GNUSTEP_ROOT)/tool.make
记得GNUSTEP_ROOT和环境变量中设置的一致。
make
在obj目录下有个可执行文件HelloWorld , 执行该文件输出:
./obj/HelloWorld 2014-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 installed E: Broken packages
解决方法:
sudo apt-get purge libgnustep-base1.20-dbg sudo apt-get purge libgnustep-gui0.18-dbg sudo apt-get install libgnustep-gui0.18-dbg libgnustep-base1.20-dbg
相关文章推荐
- Objective C Hello World 之Windows平台环境搭建
- Objective C Hello World 之Windows平台环境搭建
- CUDA入门——环境搭建,hello world cuda(1)
- Android NDK 环境搭建 之 起始篇NDK HelloWorld
- 自己动手搭建 Redis 环境,并建立一个 .NET HelloWorld 程序测试
- PHP环境搭建以及helloworld.php
- 自己动手搭建 MongoDB 环境,并建立一个 .NET HelloWorld 程序测试
- 在Ubuntu 10.04中搭建Objective-C 开发环境
- Ubuntu/Kubuntu Objective-C 开发环境搭建 (续)
- Weex系列笔记(一)环境搭建,Hello Weex World
- 百度地图开发环境搭建BDHelloWorld
- 在Ubuntu 10.04中搭建Objective-C 开发环境
- Android NDK 环境搭建 之 起始篇NDK HelloWorld
- Drools入门-----------环境搭建,分析Helloworld Drools5.0的xls文件转drl文件提升解析效率 使用BRMS的Tomcat6.0配置
- 搭建安卓开发环境 hello world andriod
- Activiti Workflow HelloWorld 示例与测试环境搭建
- 在 Ubuntu 中使用 GNUstep 搭建 Objective-C 开发环境
- java 环境搭建,以及hello,world 。
- 在 Ubuntu 中使用 GNUstep 搭建 Objective-C 开发环境
- Android:Windows64位搭建开发环境-JDK,SDK,Eclipse,ADT,AVD-HelloWorld Example,genymotion