- 浏览: 1504459 次
- 性别:
- 来自: 南京
文章分类
- 全部博客 (419)
- XMPP (19)
- Android (180)
- Java (59)
- Network (4)
- HTML5 (13)
- Eclipse (9)
- SCM (23)
- C/C++ (4)
- UML (4)
- Libjingle (15)
- Tools&Softwares (29)
- Linphone (5)
- Linux&UNIX (6)
- Windows (18)
- Google (10)
- MISC (3)
- SIP (6)
- SQLite (5)
- Security (4)
- Opensource (29)
- Online (2)
- 文章 (3)
- MemoryLeak (10)
- Decompile (5)
- Ruby (1)
- Image (1)
- Bat (4)
- TTS&ASR (28)
- Multimedia (1)
- iOS (20)
- Asciiflow - ASCII Flow Diagram Tool.htm (1)
- Networking (1)
- DLNA&UPnP (2)
- Chrome (2)
- CI (1)
- SmartHome (0)
- CloudComputing (1)
- NodeJS (3)
- MachineLearning (2)
最新评论
-
bzhao:
点赞123!
Windows的adb shell中使用vi不乱码方法及AdbPutty -
wahahachuang8:
我觉得这种东西自己开发太麻烦了,就别自己捣鼓了,找个第三方,方 ...
HTML5 WebSocket 技术介绍 -
obehavior:
view.setOnTouchListenerview是什么
[转]android 一直在最前面的浮动窗口效果 -
wutenghua:
[转]android 一直在最前面的浮动窗口效果 -
zee3.lin:
Sorry~~
When I build "call ...
Step by Step about How to Build libjingle 0.4
http://www.jaysonjc.com/programming/objective-c-programming-in-windows-gnustep-projectcenter.html
I have been toying with the idea of getting into full fledged iPhone application development for sometime now. To get into iPhone development, you need to be familiar with Objective C language and Cocoa framework. But the iPhone development environment is only available for Mac platform (which includes Xcode IDE and iPhone simulator). If you want to run iPhone development environment without a Mac machine, you have two options,
- Use a virtual machine platform like VMWare to run OSX under Windows – However it is not legal to run OSX under non Apple hardware.
- Another option is to use OSx86 which allows you to install Mac OS on top of your Intel or AMD computer.
But if you just want to learn Objective C language or Cocoa framework programming, you don’t need any of the above. You just need the GNUStep and ProjectCenter tools. This article explains how GNUStep can be configured as a Objective C development environment on Windows.
Objective C Programming in Windows using GNUStep
GNUStep is a free, object oriented development environment with built in tools such as a compiler. The C/C++ compiler included (gcc) also supports compiling Objective C programs. It also has a graphical development kit with API similar to Cocoa framework (since both of them were derived from the old OpenStep framework). So installing GNUStep on Windows gives an instant development environment for Objective C programs. An extension to GNUStep is the ProjectCenter (Xcode equivalent) using which graphical programs can be built.
Installing GNUStep on Windows
GNUStep is available as a Windows installer from the official page . I recommend downloading and installing GNUStep System, GNUStep Core and GNUStep Devel. Note that the latest version available as of October 2009 is 0.23.0 and this version is not compatible with ProjectCenter 0.50 . If you are planning to use ProjectCenter I recommend that you download 0.22.0 version of GNUStep from the download page . Here is a summary of what is required,
- Objective C programming only – GNUStep 0.23 (System | Core | Devel )
- Objective C Programming and ProjectCenter 0.50 - GNUStep 0.22 (System | Core | Devel )
You can download pre-compiled version of ProjectCenter 0.50 for Windows from here .
Once you install all the binaries above, you will have GNUStep shell under Programs->GNUStep (See figure). Click on the Shell to invoke the command line interface. This shell is based on MinGW (collection of gcc compiler and command line tools) and using it you can compile and run Objective C programs. The command line is similar to Unix/Linux command line and you can navigate to any folder in your windows machine. Using the built in gcc program you can compile and run Objective C programs.
Compiling and running Objective C programs in GNUStep on Windows
Create the following program and save it with the name helloworld.m using notepad,
#import <Foundation/Foundation.h> int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; NSLog (@"Hello World!"); [pool drain]; return 0; }
Now using GNStep shell navigate to the folder where helloworld.m is stored (in my case it is cd w:/prg ). Type in the following command to compile helloworld.m.
gcc -o helloworld helloworld.m -I /GNUstep/System/Library/Headers -L /GNUstep/System/Library/Libraries -lobjc -lgnustep-base -fconstant-string-class=NSConstantString
Please note that the various switch options such as -lobjc should appear at the end of the command. the -o switch specifies the name of the executable created (helloworld.exe) in this case. Following is the result of compilation,
Info: resolving ___objc_class_name_NSAutoreleasePool by linking to __imp____objc _class_name_NSAutoreleasePool (auto-import) Info: resolving ___objc_class_name_NSConstantString by linking to __imp____objc_ class_name_NSConstantString (auto-import) W:\Tools\GNUstep\mingw\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.e xe: warning: auto-importing has been activated without –enable-auto-import spec ified on the command line. This should work unless it involves constant data structures referencing symbols from auto-imported DLLs.
You can see that helloworld.exe is generated in the same folder (Ignore compiler output and warnings or use -enable-auto-import switch to fix them). To run the program type in ./helloworld.exe at the command prompt,
Common Errors during Objective C compilation
- error: cannot find interface declaration for `NXConstantString’ – This means that you haven’t added the switch -fconstant-string-class=NSConstantString to the gcc command line.
- Foundation/Foundation.h: No such file or directory – This means that gcc is unable to find Foundation header classes. Use the switches -I /GNUstep/System/Library/Headers -L /GNUstep/System/Library/Libraries
- stray ‘@’ in program – This means that you have the wrong double quote in your source code. Use " instead of ” .
Now you are all set for Objective C programming and a bit of Cocoa programming on Windows. Good luck! and buy a Mac machine when you are ready to write iPhone programs.
Further Reference
发表评论
-
Nuance - Dragon Mobile SDK - Speech Kit
2012-07-02 15:57 1415http://dragonmobile.nuancemobil ... -
iOS的开源库和开源项目
2012-06-14 10:54 1025http://www.cocoachina.com/iphon ... -
[iOS开发教程-5]Create Indexed UITableView
2012-06-13 16:31 1742http://www.iphonedevcentral.com ... -
[iOS开发教程-4]Create a UITabBarController from scratch
2012-06-13 15:20 1434http://www.iphonedevcentral.com ... -
[iOS开发教程-3]Create a Detail View Page using UIImageView, UITextView and UILabel
2012-06-13 14:11 2136http://www.iphonedevcentral.com ... -
[iOS开发教程-2]Customize that UIViewCell – Part 1: Using Interface Builder
2012-06-13 13:00 1488http://www.iphonedevcentral.com ... -
[iOS开发教程-1]Hello UITableView!
2012-06-13 11:12 2083http://www.iphonedevcentral.com ... -
Window 7主机与VMware中Mac虚拟机共享文件夹
2012-06-08 23:28 191421. 确保针对Mac虚拟机的VMware Tools的安装 ... -
VMware 8.02虚拟机安装MAC lion 10.7.3教程 附送原版提取镜像InstallESD.iso!
2012-06-08 23:14 6365http://www.winthink.net/thread- ... -
[iOS]深入浅出 iOS 之多线程 NSThread
2012-06-08 15:30 21310http://www.cocoachina.com/bbs/r ... -
Object-C中的Selector概念
2012-06-08 15:25 1103selector可以叫做选择器,其实指的就是对象的方法,也 ... -
CodeBlocks集成Objective-C
2012-06-05 23:35 1194http://www.jxva.com/?act=blog!a ... -
用ultraEdit打造自己的Objective-C IDE for Windows
2012-06-05 21:41 1488http://blog.csdn.net/tomatofly/ ... -
Windows下UltraEdit查看Objective-C代码高亮工具
2012-06-05 21:26 2497http://www.cocoachina.com/bbs/r ... -
Objective-C 编程教程(全)
2012-06-04 23:32 1284http://www.youku.com/playlist_s ... -
iPhone开发学习笔记
2012-06-04 22:15 2685http://blog.csdn.net/huanglx198 ... -
Installing and using GNUstep and Objective-C on Windows
2012-06-04 16:49 1052http://www.techotopia.com/index ... -
GNUStep
2012-06-04 16:45 1246http://www.gnustep.org/ T ... -
The Objective-C Programming Language
2012-06-03 19:31 1033http://developer.apple.com/libr ...
相关推荐
可以使用GNUstep在Windows XP上寫Objective-C程式,但是Objective-C已經加了很多新東西,而GNUstep裡的gcc並不提供,所以,这个是GNUstep,再加上新一代的編譯器架構Clang與LLVM(這也是Apple在新版Xcode裡預設使用...
the gnustep-msys-system package
总结来说,在Windows系统下搭建Objective-C开发环境虽然不像在Mac OS X上那样直接便捷,但通过使用GNUstep等工具,我们依然可以实现在Windows系统下的Objective-C开发。希望这份详细的指南能够帮助那些需要或希望在...
CodeBlocks和GNUstep是两种广泛使用的开源开发工具,它们在Objective-C编程中扮演着重要的角色。Objective-C是一种面向对象的编程语言,它是苹果生态系统,包括iOS和macOS开发的基础。本篇文章将详细介绍如何配置和...
在Windows系统上配置Objective-C的编译运行环境可能比在Mac上更为复杂,因为Objective-C主要是为Apple的iOS和macOS平台设计的。不过,通过一些工具和步骤,你可以在Windows上搭建一个基本的环境来学习和实验...
尽管它主要与苹果的Xcode IDE紧密关联,但在Windows环境下,我们同样可以通过配置其他工具来搭建Objective-C的开发环境。本文将详细介绍如何在Windows上使用Codeblocks作为IDE来搭建Objective-C的开发环境。 首先,...
然而,描述中提到的GNUstep项目使得Objective-C的使用范围扩展到了非苹果平台,包括Windows操作系统。在这个场景下,我们关注的是如何在Windows 7环境下编译和运行Objective-C代码。 GNUstep是一个开源项目,它的...
6. **开发工具**:GNUstep提供了Gorm(GUI构建工具)和ProjectCenter(项目管理工具),帮助开发者设计用户界面和管理项目。这些工具可以帮助你快速创建和组织代码,以及可视化布局界面。 7. **社区支持**:GNUstep...
在Windows平台上搭建Objective-C开发环境是一项相对复杂但可行的任务,主要依赖于GNUstep项目,它是一个开源实现的Objective-C环境,旨在提供与Apple的Mac OS X上的Cocoa类似的功能。以下是一个详细的步骤指南: 1....
- **编译工具**: GNUGCC 3.x版本开始支持Objective-C语言,GNUStep项目还提供了一个名为GNUstep Make的工具,简化了Objective-C程序的构建过程。GNUstep Make使用类似Makefile的语法,即GNUmakefile,使构建过程更加...
GNUstep OC 编译学习工具包是一套专为Windows用户设计的编程工具,旨在帮助开发者在Windows环境下编译和学习Objective-C(OC)程序。Objective-C是苹果公司开发的面向对象编程语言,广泛用于iOS和macOS应用开发。...
本文旨在详细介绍如何在 Windows XP 操作系统中搭建一套基于 GNUstep 和 CodeBlocks 的 Objective-C 集成开发环境(IDE)。该环境对于希望在 Windows 平台上进行 Objective-C 应用程序开发的开发者来说非常实用。 #...
GNUstep Objective C iPhone Apple GNUstep Objective C iPhone Apple GNUstep Objective C iPhone Apple
### Windows配置Objective-C开发环境详细教程 #### 一、引言 随着移动互联网的发展,Objective-C作为iOS开发的重要语言之一,其应用范围虽然主要集中在Mac OS X和iOS平台,但有时候开发者可能需要在Windows平台上...
然而,通过使用GNUstep,一个开源的Objective-C框架,开发者可以在Windows上构建和运行Objective-C代码。下面将详细介绍如何在Windows下设置Objective-C的开发环境,并编写并运行一个简单的“Hello, World!”程序。 ...
Objective C是一种由苹果公司推出的基于C语言的面向对象编程语言,主要用于开发iOS和macOS平台的应用程序。在本文中,我们将探讨如何在Windows环境下搭建Objective C的开发环境,这对于那些想学习Objective C但又...
Objective-C是一种广泛用于苹果平台应用程序开发的编程语言,它是C语言的一个超集,并加入了Smalltalk风格的消息传递机制。本篇教程主要面向初学者,介绍了Objective-C的基础知识点和一些核心概念。 1. Objective-C...
在Windows环境下进行Objective-C开发可能不如在macOS上直观,但通过GNUStep提供的工具链,我们仍然可以实现跨平台的开发。熟悉这些工具和命令行操作对于提升开发效率至关重要。随着对Objective-C语法和GNUStep的理解...
1. **Objective-C 语言**: Objective-C是C语言的超集,添加了Smalltalk式的消息传递机制,是Cocoa和GNUstep框架的基础。它支持面向对象编程,是开发Mac OS X和iOS应用的主要语言。在GNUstep中,Objective-C同样用于...