Windows PlatformLowerObjective-C simulated DevelopmentEnvironment setup is the content of this article, mainly to learn howWindows PlatformImplementationObjective-C simulated DevelopmentEnvironment setup, including installing GNUstep, compiling Hello, World! , Objective-C program compilation, gcc shortcuts, etc.Objective-CWindows,Objective-C simulated DevelopmentEnvironment,Objective-CDownload the development environment,Objective-CDevelopment Environment installation.
1. Install GNUstep
GNUstep Official Website
GNUstep Windows Installer provides a simulated development environment for Objective-C on the Windows platform. There are four software packages, including GNUstep System and GNUstep Core, and GNUstep Devel and Cairo Backend.
2. Write Hello, World!
After the installation is complete, execute shell in the GNUstep option in the Start menu to open the command line. Here, you can use vi to compile the Objective-C program, however, the operation is always complicated. In fact, you can directly go to the C: \ GNUstep \ home \ username directory on the Windows platform. Here you can use your preferred tools to compile the Objective-C program, then compile the program in shell.
The content of the helloworld. m file is provided directly, which is taken from Programming in Objective-C 2.0:
Reference content is as follows:
- #import <Foundation/Foundation.h>
- int main (int argc, const char *argv[]) {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- NSLog(@"Hello World!");
- [pool drain];return 0;
- }
3. Program Compilation
First compilation:
The gcc-o helloworld. m result has an error message. The header file cannot be found:
Reference content is as follows:
- helloworld.m:1:34: Foundation/Foundation.h: No such file or directory
- helloworld.m: In function `main':
- helloworld.m:4: error: `NSAutoreleasePool' undeclared (first use in this function)
- helloworld.m:4: error: (Each undeclared identifier is reported only once
- helloworld.m:4: error: for each function it appears in.)
- helloworld.m:4: error: `pool' undeclared (first use in this function)
- helloworld.m:5: error: cannot find interface declaration for `NXConstantString'
Summary:Windows PlatformLowerObjective-C simulated DevelopmentThe environment has been set up. I hope this article will help you!