In Windows, compile and run Objective-C and use UltraEdit as IDE. objectivec Compiler

Source: Internet
Author: User
Tags word wrap ultraedit

In Windows, compile and run Objective-C and use UltraEdit as IDE. objectivec Compiler

This is an alternative. Without Mac OS X, you can use this solution to understand Objective-C first.

If you think it's good to play, you 'd better go into the development of the entire Mac.

 

I. Install GNUStep in the compiling environment

Download the following three packages from www.gnustep.org and install them in sequence.

1. gnustep-msys-system-0.30.0-setup.exe

2. gnustep-core-0.31.0-setup.exe

3. gnustep-devel-1.4.0-setup.exe

Ii. Run Shell

Start> All Programs> GNUstep> Shell

Run in a MINGW32 window. "/" The root directory is the "GNUstep installation directory \ msys \ 1.0.

The/home/username/directory is entered by default. "~ "Directory.

Iii. Compilation and running

Use vim in Shell to edit a hello. m

 1 #import <Foundation/Foundation.H> 2  3 int main(int argc, const char *argv[]) 4 { 5     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 6      7     NSLog(@"Hello, World!"); 8      9     [pool drain];10     11     return 0;12 }

Run the following command in the Shell command line to get hello. o.

gcc -fconstant-string-class=NSConstantString -c hello.m -I /GNUstep/System/Library/Headers

Execute the following command to go to hello.exe.

gcc -o hello hello.o -L /GNUstep/System/Library/Libraries/ -lobjc -lgnustep-base

Okay. Run the command to check the result.

./hello2015-03-16 10:29:11.019 hello[4172] Hello, World!

 

OK. Next, configure UltraEdit to make it an IDE in Windows.

The UltraEdit version used here is 21.10.0.1032. Other versions are similar. For more information, see

I. syntax highlighting

Choose-Advanced-Configuration-Editor Display-Syntax Highlighting-"Full directory path for wordfiles :"

  

Put the objc-highlight.uew in the directory.

Ii. Automatic completion

Choose Advanced-Configuration-Editor-Word Wrap/Tab Settings-"Auto-complete file :"

  

Use the objc-auto.stx file.

After completing the above two steps, check the effect:

 

III. The following configuration can be used to compile, connect, and run in UltraEdit.

Open menu-Advanced-Tool Configuration dialog box

  

Insert four commands on the Command tab:

1) Build objc single

This is to compile the currently opened file

In Command line: Enter

gcc -fconstant-string-class=NSConstantString -c %n%e -I C:\GNUstep\GNUstep\System\Library\Headers

Note the installation path of the above GNUstep.

2) Build objc all

This is to compile all the files in the current directory.

In Command line: Enter

gcc -fconstant-string-class=NSConstantString -c -Wall *.m -I C:\GNUstep\GNUstep\System\Library\Headers

3) Link objc all

This is to connect all ofiles under the current directory and generate main.exe

In Command line: Enter

gcc -o main -Wall *.o -L C:\GNUstep\GNUstep\System\Library\Libraries\ -lobjc -lgnustep-base

4) Run objc main

This is to run main.exe

In Command line: Enter

main.exe

The Working directory of the preceding four commands is set to % p, that is, the current directory.

Select the Options tab "Save active file:

  

The Output tab is set as follows:

  

After all the preceding settings are complete, the Advanced menu will run the following command:

  

The compilation, connection, and running results are Output in the Output Window.

  

 

All right, all the configurations are done here. Hurry up and write the program.

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.