The first thing to note is:
Although gnustep can be installed and used on Windows, it is mainly intended for Linux users rather than Windows users. If you have good Linux development experience, it is good to use gnustep. Gnustep is not powerful and only has the foundation library. Therefore, it is recommended that you spend more time on xcode!
Recently I learned objective-C, but I am very poor and can't afford xcode. Therefore, we plan to use the gnustep environment to compile and run the objective-C file. However, I found some online tutorials, which are old and copy each other. Some errors are reported. So I plan to write down the correct steps. If you have a better, simpler, and more correct method, please leave a message and I will learn and correct it. Thank you!
Go to http://www.gnustep.org/experience/windows.html to download the three sets of gnustep. Many articles are written to download two programs. In fact, GCC is now in the third file. The first two cannot be used.
These tools are gnustep msys system, gnustep core, and gnustep devel.
Download the package and install it. Click it all the way.
Then you can use it. Program> gnustep> shell. It can be used in 2 seconds after being turned on.
For example, edit the fraction. M file in the directory of drive f using text. The Code is as follows (the simplest obj-C program ):
# Import <Foundation/Foundation. h>
Int main (INT argc, char * argv []) {
NSAID utoreleasepool * Pool = [[NSAID utoreleasepool alloc] init];
Nslog (@ "Hello world! ");
[Pool drain];
Return 0;
}
Input cd f:/in shell to switch to the directory of drive F, and then
Enter the command in shell: gcc-fconstant-string-class = nsconstantstring-C fraction. M-I/gnustep/system/library/Headers
This is a fraction. o file generated in the directory. (If this step is successfully completed, nothing is displayed in the command line. If yes, the display is incorrect)
Next, enter the command gcc-O fraction. O-L/gnustep/system/library/libraries/-lobjc-lgnustep-base.
If successful, a fraction.exe file is generated in the directory.
Finally, run the command./fraction.exe to view the output result. My result is: 19:30:33. 078 fraction [4824] Hello world!
Successful!
Source: http://blog.sina.com.cn/s/blog_61e24fd70100psrz.html