Download GNUstep
In the GNUstep environment, you can use the MinGW tool in Windows. The MinGW is a portable version of the GNU compilation tool in Windows. Installing GNUstep includes installing MinGW and GNUstep, both of which can be downloaded here: http://www.gnustep.org/experience/Windows.html.
MinGW includes GNUstep System and GNUstep Core, which must be installed first.
Install MinGW and GNUstep
After downloading the required package, you can start installation. In the graphical Installation Wizard interface, we specify the installation directory as C: \ GNUstep.
Once MinGW is installed, you can install the GNUstep Core package.
Run GNUstep Shell
To start using Objective-C and GNUstep, start the GNUstep shell and run the Shell from the GNUstep in the Start Menu, as shown in:
Test after installation
This Shell environment is a minimal version of Linux or Unix environment. If you are not familiar with this environment, you can also use the editor you are familiar with in Windows.
When the Shell is started for the first time, it will enter the default home directory:
C: \ GNUstep \ home \ <username>
<Username> indicates the user name used to log on to Windows. Enter the following code to create a simple application:
01 |
# Import <Foundation/Foundation. h> |
03 |
Int main (int argc, const char * argv []) |
05 |
NSAID utoreleasepool * pool = [[NSAID utoreleasepool alloc] init]; |
07 |
NSLog (@ "hello world "); |
Save the preceding code to the "hello. m" file in the main directory. You can use any editor to edit the file.
Run the following command to compile:
1 |
$ Gcc 'gnustep-config -- objc-flags '-L/gnustep/System/Library/Libraries hello. m-o hello-lgnustep-base |
If the compilation is successful, run the following command to execute the program:
The program output information is as follows:
1 |
14:31:25. 721 hello [2200] hello world |