Build the objecitve-c compiling environment in windows.

Source: Internet
Author: User

Although java is used, we also know that obj-c is similar to java. Programming is similar to thinking.

However, the syntax of objective-c is weird and it still takes time to adapt. As I haven't bought a mac yet, I have set up an objective-c compiling environment in windows. Get used to it. Obj-c development.

 

To build an Objective C development environment in Windows, you need to download the three software packages from the GNUstep Official Website: GNUstep MSYS System, GNUstep Core, and GNUstep Devel. These three packages are required for obj-c development.

 

To put it bluntly, download the software package and click "Install". Note that you need to store the three packages in a folder. (I opened the three folders of the three installation packages in an error.

.).

 

Then, check whether the installation is successful and whether the Objective C code can be compiled successfully.

Compile an Objective C code to compile and run the test. Here we use the classic "hello world" to describe:

# Import <Foundation/Foundation. h>

Int main (int argc, const char * argv []) {

NSAID utoreleasepool * pool = [[NSAID utoreleasepool alloc] init];

NSLog (@ "Hello World! ");

[Pool drain];

Return 0;

}

Copy a Copy of the Code as follows: Put it in the E: \ objective-c \ gnu \ GNUstep \ home directory, helloworld. m

Then, click:

1. Start --- "program ---- GUNstep-à shell open a window: then enter

2. Use the command line to enter: E: \ objective-c \ gnu \ GNUstep \ home

3. write gcc-o helloworld. m-I/GNUstep/System/Library/Headers-fconstant-string-class = NSConstantString-L/GNUstep/System/Library/Libraries-lobjc-lgnustep-base

Pay attention to the red word, which is an uppercase word worth tens of millions of attention and is easy to confuse. I was delayed for a long time.

4. Write the./helloworld.exe file to get the hello world success.

5. Start obj-c Development

 

NND: it took a whole morning to get the environment ready. I didn't pay attention to some details. I am so confused... I have mentioned two details above. I hope the readers will notice that it will take at most 10 minutes to get it done, but it took me a few hours to read other people's blogs, which is not so detailed, the fatal point is not pointed out. It is harmful...

 

 

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.