GNUstep Windows Installer提供了Windows平台下的Objective-C的類比開發環境,一共有四個軟體包,
其中GNUstep System和GNUstep
Core是必裝的,GNUstep Devel和Cairo
Backend是選裝的。
甭管必裝選裝,一次性全安上,免得以後麻煩。
編寫Hello, World!
1.安裝後在環境變數PATH中增加:
C:\GNUstep\GNUstep\System\Tools;C:\GNUstep\bin;C:\GNUstep\mingw\bin
安裝後運行GNUstep shell也就是安裝目錄下的msys.bat。測試一下gcc與make命令。
2: 測試程式
test.m
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];6 return 0;7 }
3.在Shell中輸入命令:
gcc -fconstant-string-class=NSConstantString -c testm -I /GNUstep/System/Library/Headers
這是目錄裡就會產生test.o和test.exe檔案。
4.UltraEdit下配置Objective-c高亮顯示
#追加到 UltraEdit設定檔末尾
/L14"Objective-C" OBJECTIVE-C_LANG Line Comment = // Block Comment On = /* Block Comment Off = */ Escape Char = \ String Chars = "' String Literal Prefix = @ File Extensions = H M MM PCH
/Delimiters = ~!@%^&*()-+=|\/{}[]:;"'<> , .?
/Function String = "%^([a-zA-Z_0-9^[^]*]+^)[ ^t]+([^p*&:, ^t^[^]a-zA-Z_0-9.!]++)[~;]"
/Function String 1 = "%[a-zA-Z_0-9*]*::^([a-zA-Z_0-9^~]+^)[ ^t^p]++([^p*&:, ^t^[^]/*^-'=:&a-zA-Z_0-9./(!]++)[~;]"
/Function String 2 = "%[a-zA-Z_0-9^][a-zA-Z_0-9^[^]]+[ ^t*]+^([a-zA-Z_0-9]+^)[ ^t]++([^p*&:, ^t^[^]a-zA-Z_0-9./(!]++)[~;]"
/Function String 3 = "%[a-zA-Z_0-9*&$^[^]*]+[ ^t]+[a-zA-Z_0-9*&$^[^]]+[ ^t*]+^([a-zA-Z_0-9]+^)[ ^t]++([^p*&:, ^t^[^]a-zA-Z_0-9./(!]++)[~;]"
/Function String 4 = "%[a-z_0-9^[^]*]++ [a-z_0-9*^[^]]+[ ^t]++[a-z_0-9*^[^]]+[ ^t]++^([*a-z_0-9]+^)[ ^t]++([^p*&:, ^t^[^]a-z_0-9./(!]++)[~;]"
/Function String 5 = "%^([a-zA-Z_0-9^[^]*]+^)[ ^t]++([^p*&:, ^t^[^]a-zA-Z_0-9./()!]++)[~;]"
/Member String = "^([A-Za-z0-9_:.]+^)[ ^t^*&]+$S[ ^t^[^]A-Za-z0-9_]++[(-);,]"
/Variable String = "%[ ^t]++^([!-~ ^t<>]+*[~a-z^p]^)$S[ ^t;,()^-]"
/Indent Strings = "{"
/Unindent Strings = "}"
/Open Brace Strings = "{" "(" "["
/Close Brace Strings = "}" ")" "]"
/Open Fold Strings = "{"
/Close Fold Strings = "}"
/C1"Keywords" STYLE_KEYWORD
_Bool _Complex _Imaginary _cmd __func__
__asm __based __cdecl __declspec __except __far __fastcall __finally __fortran __huge __inline __int16
__int32 __int64 __int8 __interrupt __leave __loadds __near __pascal __saveregs __segment __segname __self
__stdcall __try __uuidof __multiple_inheritance __single_inheritance __virtual_inheritance
auto do double assign
bool break bycopy byref
BOOL
char class case const continue const_cast catch copy
Class
defined default do double delete dynamic_cast dllexport dllimport
enum extern else explicit export
for float false friend
goto getter
int if in inline inout id init
IMP
long
mutable
nil namespace new naked nonatomic
Nil NO NSObject
oneway out operator
Object
private protected public
Protocol
return register restrict reinterpret_cast retain readwrite readonly
self short signed sizeof static struct super switch static_cast setter
SEL
typedef template this throw true try typeid typename thread
union unsigned using uuid
void volatile virtual
while wchar_t
YES
** @ #
/C2"Operators" STYLE_OPERATOR
@
#
:
!
%
&
+
-
*
// /
<
=
>
^
|
~
?
,
/C3"Framework" STYLE_EXTENSION
alloc
dealloc
Foundation
release
** NS IB CF CA CG UI GL EAGL
/C4"OpenGL" STYLE_KEYWORD
** gl