- 浏览: 1480419 次
- 性别:
- 来自: 南京
文章分类
- 全部博客 (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 1366http://dragonmobile.nuancemobil ... -
iOS的开源库和开源项目
2012-06-14 10:54 979http://www.cocoachina.com/iphon ... -
[iOS开发教程-5]Create Indexed UITableView
2012-06-13 16:31 1703http://www.iphonedevcentral.com ... -
[iOS开发教程-4]Create a UITabBarController from scratch
2012-06-13 15:20 1384http://www.iphonedevcentral.com ... -
[iOS开发教程-3]Create a Detail View Page using UIImageView, UITextView and UILabel
2012-06-13 14:11 2087http://www.iphonedevcentral.com ... -
[iOS开发教程-2]Customize that UIViewCell – Part 1: Using Interface Builder
2012-06-13 13:00 1433http://www.iphonedevcentral.com ... -
[iOS开发教程-1]Hello UITableView!
2012-06-13 11:12 2023http://www.iphonedevcentral.com ... -
Window 7主机与VMware中Mac虚拟机共享文件夹
2012-06-08 23:28 190951. 确保针对Mac虚拟机的VMware Tools的安装 ... -
VMware 8.02虚拟机安装MAC lion 10.7.3教程 附送原版提取镜像InstallESD.iso!
2012-06-08 23:14 6326http://www.winthink.net/thread- ... -
[iOS]深入浅出 iOS 之多线程 NSThread
2012-06-08 15:30 21240http://www.cocoachina.com/bbs/r ... -
Object-C中的Selector概念
2012-06-08 15:25 1051selector可以叫做选择器,其实指的就是对象的方法,也 ... -
CodeBlocks集成Objective-C
2012-06-05 23:35 1155http://www.jxva.com/?act=blog!a ... -
用ultraEdit打造自己的Objective-C IDE for Windows
2012-06-05 21:41 1449http://blog.csdn.net/tomatofly/ ... -
Windows下UltraEdit查看Objective-C代码高亮工具
2012-06-05 21:26 2444http://www.cocoachina.com/bbs/r ... -
Objective-C 编程教程(全)
2012-06-04 23:32 1242http://www.youku.com/playlist_s ... -
iPhone开发学习笔记
2012-06-04 22:15 2620http://blog.csdn.net/huanglx198 ... -
Installing and using GNUstep and Objective-C on Windows
2012-06-04 16:49 1012http://www.techotopia.com/index ... -
GNUStep
2012-06-04 16:45 1206http://www.gnustep.org/ T ... -
The Objective-C Programming Language
2012-06-03 19:31 986http://developer.apple.com/libr ...
相关推荐
可以使用GNUstep在Windows XP上寫Objective-C程式,但是Objective-C已經加了很多新東西,而GNUstep裡的gcc並不提供,所以,这个是GNUstep,再加上新一代的編譯器架構Clang與LLVM(這也是Apple在新版Xcode裡預設使用...
the gnustep-msys-system package
CodeBlocks&GNUstep开发软件环境、配置方法、配置文件资料打包。 感兴趣Objective-C学习(进一步学习IOS)的童鞋们欢迎下载。
GNUstep Objective C iPhone Apple GNUstep Objective C iPhone Apple GNUstep Objective C iPhone Apple
目前 GNU GCC 3.x 支援 Objective-C 語言, GNUstep 則提供 GNUstep Make 來簡化編譯 Objective-C 程式. GNUstep Make 提供類似 Makefile 的功能, 稱為 GNUmakefile. 與 Makefile 相比較之下 GNUmakefile 簡單許多.
Objective-C 程序中可以利用现有的C语言代码,使其利用现有的软件架构。这也是为甚莫Objective-C 过去多年间能够成为一种流行的用户界面开发语言而且至今没有消亡,因为一方面用它可以实现底层系统编程,另一方面...
GNUstep Objective C iPhone Apple GNUstep Objective C iPhone Apple GNUstep Objective C iPhone Apple GNUstep Objective C iPhone Apple
GNUstep之前只能在XP上实现编译运行Objective-C,而现在可以在Windows7上实现了,参见方法。
本文档图文并茂的给出了如何在Win XP下创建 GNUstep + CodeBlocks 的Objective-C集成开发环境,测试成功,供参考!
GNUstep安装包 支持 Objective-C 语言,,其中只有system和core
GNUstep Objective C iPhone Apple GNUstep Objective C iPhone Apple
GNUstep Objective C iPhone Apple GNUstep Objective C iPhone Apple 共六部分
GNUstep Objective C iPhone Apple GNUstep Objective C iPhone Apple 共六部分
GNUstep Objective C iPhone Apple GNUstep Objective C iPhone Apple 共六部分
這是GNUStep 出的第七版的 Objectie-C Runtime 的實現了。兼容了蘋果官方 10.7級別的依賴與API兼容。讀一讀非常有好處。運行時的源碼。
GNUstep object-c函数学习手册 帮助你学习oc
Objective-C语言IDE工具 Gorm-1.2.10-setup.rar
gnustep-devel-1.4.0-setup.exe
GNUStep GUILibraryAPI Gui类库 ObjectiveC
GNUStep gnustep-msys-system-0.28.1-setup.exe object-c开发环境,window下搭建object-c开发环境。