Objective-C programming using mingw32 in Windows
Following are the steps you need to follow to setup the environment and run your first program
| S.No | Description | Link/Path/Command | Note |
|---|---|---|---|
| 1 | Install mingw32 and its libraries | http://www.gnustep.org/experience/Windows.html | Make sure you install the first two packages provided in the link (in the same order mentioned) |
| 2 | Open mingw32 | Start –> Programs –> GNUStep –> Shell | |
| 3 | Write our first program | The command prompt location points to the following path: %GNUStep_Directoy%/home/your_name/ (“D:\GNUstep\home\Prabhu B” for me) |
FirstProgram.h FirstProgram.m (Refer below for the content of the .h and .m files) |
| 4 | Compile the program |
gcc -o FirstProgram FirstProgram.m –I /GNUstep/System/Library/Headers/ -L /GN |
|
| 5 | Run the program | ./FirstProgram |
| FirstProgram.h | FirstProgram.m |
|---|---|
|
#import<Foundation/NSObject.h> @interface FirstProgram:NSObject { } -(int) addNumber1 : (int) x withNumber2 : (int) y; @end |
#import "FirstProgram.h" @implementation FirstProgram -(int)addNumber1: (int) x withNumber2: (int) y { //add |
leave a comment