Windows平台下Objective-C模拟开发环境搭建

移动开发 iOS
Windows平台下Objective-C模拟开发环境搭建 是本文要介绍的内容,主要是来学习如何在Windows平台下实现Objective-C 模拟开发环境搭建,包括安装 GNUstep 、编写 Hello, World! 、Objective-C程序编译、gcc 快捷方式等。

Windows平台Objective-C模拟开发环境搭建  是本文要介绍的内容,主要是来学习如何在Windows平台下实现Objective-C 模拟开发环境搭建,包括安装 GNUstep 、编写 Hello, World! 、Objective-C程序编译、gcc 快捷方式等。Objective-C Windows,Objective-C 模拟开发环境,Objective-C 开发环境下载,Objective-C 开发环境安装。

1、安装 GNUstep

GNUstep 官方网站

GNUstep Windows Installer 提供了 Windows 平台下的 Objective-C 的模拟开发环境,一共有四个软件包,其中GNUstep System 和 GNUstep Core 必装,GNUstep Devel和Cairo Backend 选装。

2、编写 Hello, World!

安装完成后,在开始菜单里的GNUstep选项里执行shell,就能打开命令行,在这里就可以使用vi编写Objective-C程序了,不过操作起来总有些繁琐,其实也可以直接在Windows平台里进入C:\GNUstep\home\username目录,在这里用你喜欢的工具编写Objective-C程序,然后再进入shell里编译。

直接给出 helloworld.m 文件内容,取自 Programming in Objective-C 2.0一书:

以下为引用内容:

  1. #import <Foundation/Foundation.h> 
  2. int main (int argc, const char *argv[]) {  
  3. NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];  
  4. NSLog(@"Hello World!");  
  5. [pool drain];return 0;  

3、程序编译

***次编译:

以下为引用内容:gcc -o helloworld helloworld.m结果出现错误信息,找不到头文件:

以下为引用内容:

  1. helloworld.m:1:34: Foundation/Foundation.h: No such file or directory  
  2. helloworld.m: In function `main':  
  3. helloworld.m:4: error: `NSAutoreleasePool' undeclared (first use in this function)  
  4. helloworld.m:4: error: (Each undeclared identifier is reported only once  
  5. helloworld.m:4: error: for each function it appears in.)  
  6. helloworld.m:4: error: `pool' undeclared (first use in this function)  
  7. helloworld.m:5: error: cannot find interface declaration for `NXConstantString'  

小结:Windows平台Objective-C模拟开发环境搭建的内容介绍完了,希望通过本文的学习能对你有所帮助!

责任编辑:zhaolei 来源: 百度博客
相关推荐

2011-08-22 09:48:16

WindowsObjective-C

2011-07-27 17:41:35

Objective-C Xcode

2014-04-01 10:50:42

iOS开发runtimeObjective-C

2011-08-04 15:55:50

Windows 编译 Objective-

2011-08-03 16:22:05

Objective-C CodeBlocks

2011-04-08 10:51:17

Objective-CiOS

2011-05-11 15:58:34

Objective-C

2013-03-27 12:54:00

iOS开发Objective-C

2011-05-11 11:20:26

Objective-C

2013-06-20 10:40:32

Objective-C实现截图

2011-08-10 18:07:29

Objective-C反射

2011-07-29 15:47:21

iPhone开发 Objective- C

2011-07-18 14:59:20

iPhone Objective-

2012-04-23 11:00:56

iOS开发Objective-CJavaScript

2011-07-07 17:04:33

iPhone Action Objective-

2014-04-03 09:36:47

Objective-Cruby消息传递

2011-07-25 17:31:49

iPhone Objective-

2011-07-28 15:11:23

iOS Objective-

2014-09-26 09:49:48

SwiftObjective-C

2010-09-01 09:19:33

Objective-CiPhone开发iPhone
点赞
收藏

51CTO技术栈公众号