This is a stopgap measure, and in the absence of Mac OS X, use this scheme to get a sense of objective-c.
If it feels good to play down, want to go deeper, or the whole Mac.
One: Compile environment installation GNUstep
www.gnustep.org website Download the following three packages, installed sequentially
1. Gnustep-msys-system-0.30.0-setup.exe
2. Gnustep-core-0.31.0-setup.exe
3. Gnustep-devel-1.4.0-setup.exe
Two: Run the shell
Start and all Programs, GNUstep, Shell
Run up a MINGW32 window. The "/" root directory is the "GNUstep installation directory \msys\1.0\" directory.
The default entry is the "/home/User name/" directory. Both "~" directories.
Three: Compile, run
Use Vim to edit a hello.m in the shell
1 #import<Foundation/Foundation.H>2 3 intMainintargcConst Char*argv[])4 {5NSAutoreleasePool *pool =[[NSAutoreleasePool alloc] init];6 7NSLog (@"Hello, world!.");8 9 [Pool drain];Ten One return 0; A}
After saving, execute the following command on the shell command line to get HELLO.O
Gcc-fconstant-string-class=nsconstantstring-c hello.m-i/gnustep/system/library/headers
Then execute the following command to get Hello.exe
Gcc-o Hello hello.o-l/gnustep/system/library/libraries/-lobjc-lgnustep-base
All right, run and see the results.
./Hello2015-03-16 10:29:11.019 hello[4172] Hello, world!
OK, Next, configure UltraEdit to become the IDE under our windows.
The UltraEdit used here is 21.10.0.1032 version, other versions are similar, you can refer to
One: Syntax highlighting
Open Menu--advanced-configuration-editor display-syntax highlighting-"Full directory path for WORDFiles:"
Put the OBJC-HIGHLIGHT.UEW in the directory that you are in.
Two: auto-complete
Open menu-Advanced-configuration-editor-word wrap/tab Settings-"Auto-complete file:"
You can use the Objc-auto.stx file.
Finish the above two steps to see the effect:
Third: The next configuration, can be implemented within the UltraEdit to compile, connect, run
Open menu-advanced-tool Configuration dialog box
Command tab INSERT 4 commands:
1) Build OBJC single
This is the compilation of the currently open file
In command line: Enter
Gcc-fconstant-string-class=nsconstantstring-c%n%e-i C:\GNUstep\GNUstep\System\Library\Headers
Note the installation path of the GNUstep above.
2) Build OBJC all
This is the compilation of all the files in the current directory
In command line: Enter
Gcc-fconstant-string-class=nsconstantstring-c-wall *.m-i C:\GNUstep\GNUstep\System\Library\Headers
3) Link OBJC all
This is the connection to all O files under the current directory, generating Main.exe
In command line: Enter
Gcc-o Main-wall *.o-l C:\GNUstep\GNUstep\System\Library\Libraries\-lobjc-lgnustep-base
4) Run OBJC Main
This is run Main.exe
In command line: Enter
Main.exe
Working directory: All of the 4 commands above are set to%p, which is the current directory.
Options tab "Save active File" selected:
The Output tab page is set as follows:
After all the above settings, the Advanced menu will have the following commands:
The results of compiling, connecting, and running are output
OK, all the configuration is done here, so hurry up and start writing the program.
Windows environment, compile and run objective-c, and use UltraEdit as IDE