step 1 : installing software list
GNUstep System Required link: 0.23.0
GNUstep Core Required link: 0.23.1
i will be telling about the basic and minimum step required for compiling and running ur objective-c program
first of all
download the software and install the in the directory specified
the default directory is c:\GNUstep
run the shell from start>all program >
this will run a dos shell prompt the the shell will only run linux or unix shell command only.
this will be our window environment for development objective –c program
step 2 writing a simple program
$ vi programname.m
option for vi i insert, esq+shift+: open the command prompt s=save and q =quit u can use both or any one combination
OR
write a program in ascii test editor and save that program under the directory C:\GNUstep\home\”username folder”\
*********************************************************
// First program example
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool * pool;
pool = [[NSAutoreleasePool alloc] init];
NSLog (@"Programming is fun!");
[pool drain];
return 0;
}
********************************************************
step 3 for compiling there is some step to follow
create a
filename GNUmakefile. with these for line
*********************************************************
include $(GNUSTEP_MAKEFILES)/common.make
TOOL_NAME = LogTest
LogTest_OBJC_FILES = source.m
include $(GNUSTEP_MAKEFILES)/tool.make
*********************************************************
save the file in present program directory
for compiling run command
$ make
for running compiled program
$ ./obj/LogTest
source code download http://sites.google.com/site/phoneprogramming/objc_prog201.zip

No comments:
Post a Comment