Objective-c is an Apple software programming language that wants to learn, debug, and have an integrated development environment (IDE) handy. There are three types of methods for building OBJECTIVE-C's integrated development environment:
1) using the Apple platform, the integrated development environment uses Xcode. But if you don't have an apple platform and want to learn objective-c in a Windows environment, there are two ways to do this:
2) set up an Apple virtual machine in the Windows environment, but this is a high performance requirement for the PC, not all PCs can, and the virtual machine is running slower;
3) adopt the Codeblocks IDE development environment, configure it, build an integrated development environment that supports OBJECT-C compiling, debugging and running. This method is almost not required for the performance of personal computers and can be built quickly, this article describes this method.
1. Install Object-c Compiler
Objective-c compiler has many, this article describes the use of GNUstep, the official website address is http://www.gnustep.org/ .
HTTP Download channel:http://ftpmain.gnustep.org/pub/gnustep/binaries/windows/
FTP Download channel:ftp://ftpmain.gnustep.org/pub/gnustep/binaries/windows/
Download the following file in turn and install:
GNUstep MSYS System: gnustep-msys-system-0.30.0-setup
GNUstep Core: gnustep-core-0.34.0-setup
GNUstep Devel: gnustep-devel-1.4.0-setup
2, installation of OBJECT-C integrated development environment
We chose to use the Codeblocks IDE as the integrated development environment for OBJECTIVE-C, the official address is:http://www. Codeblocks. org/ can click here to go to the download page
3. Development environment Configuration
Through the configuration of code blocks, step by step to complete the construction of the OBJECTIVE-C development environment. Codeblocks, you can see such a picture:
First step: Configure the compiler
Enter Settings->compiler anddebugger..., select the GNU GCC Compiler compiler,
After entering the other Options page, enter :
-fconstant-string-class=nsconstantstring-std=c99
Step Two: Connector settings linkerstettings
Add two files to the connection library (link Libraries).
They are below the D:\GNUstep\GNUstep\System\Library\Libraries:
Libgnustep-base.dll.a
Libobjc.dll.a
Step Three: Specify Search directory Searchdirectories(requires pre-installed GNUstep)
1) Compiler(compiler) set to D:\GNUstep\GNUstep\System\Library\Headers;
2) Linker(connector) set to D:\GNUstep\GNUstep\System\Library\Libraries;
Fourth step: Add objective-c File type support
1) enter settings->environment ... , select Files extension handling to add *.m.
2) Enter project->projecttree->edit file types & Categories ... , in Sources, add *.m to the file type list below.
3) Enter Settings->editor ... , select Syntaxhighlighting, and click "Filemasks ...." button to add *.m to the file type at the end of the popup box .
4) click "Keywords ..." button (close to filemasks ...) Button ) to add the following object-c keyword to the editkeywords list:
@interface @implementation @end @class @selector @protocol @public @protected ID BOOL YES NO SEL nil NULL Self
4. Code Testing
Once the above development environment configuration is complete, you can begin the code test.
First, create a new project, select file->new->project ..., a project type window will appear, select Console application, then follow the construction guidelines to establish a mytest project, and rename the Main.c file to MAIN.M, enter the following code:
#import <Foundation/Foundation.h>int main (intconstChar * Argv[]) { *pool =[[NSAutoreleasePool alloc] init]; NSLog (@ "%@",@ "hello,i ' m Luka. How is it? ' " ); [Pool drain]; return 0 ;}
Then start the compile run:buid–> Run ... If the following window appears, congratulations, you have successfully built the OBJECTIVE-C integrated development environment under Windows.
Source: http://blog.csdn.net/ldl22847/article/details/7482971
OBJECTIVE-C Integrated Development Environment Setup (IDE) under Windows