Build an Objective-C simulated Development Environment on Windows

Source: Internet
Author: User

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:

 
 
  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];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:

 
 
  1. helloworld.m:1:34: Foundation/Foundation.h: No such file or directory  
  2. helloworld.m: In function `main':  
  3. helloworld.m:4: error: `NSAutoreleasePool' undeclared (first use in this function)  
  4. helloworld.m:4: error: (Each undeclared identifier is reported only once  
  5. helloworld.m:4: error: for each function it appears in.)  
  6. helloworld.m:4: error: `pool' undeclared (first use in this function)  
  7. 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!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.