Objective C Setup in Windows

Objective c in Windows

1. Download all the required installer from http://www.gnustep.org/windows/installer.html
(GNUstep MSYS System, GNUstep Core, GNUstep Devel, GNUstep Cairo)

2. Create Folder in D: drive like “D:\objective”
3. Install all the installer on that folder and structure looks like “D:\objective\GNUstep”
4. Open cmd to check MSYS is currently installed or not using “gcc –v” command.

gcc -v

5. Check The “foundation.h” file on the following path “D:\objective\GNUstep\GNUstep\System\Library\Headers\Foundation”

foundation.h

6. Create a workspace folder (like – D:\objective\workspace)
7. Write the sample code for “Hello World” in Objective C and save it as “hello.m”

#include <Foundation/Foundation.h>
int main(void)
{
    NSLog(@"Hello World!.");
	return 0;
}

8. To compile the above sample code we need to navigate the workspace folder and use the following line –

gcc -o hello.exe hello.m -I ../GNUstep/GNUstep/System/Library/Headers -L ../GNUstep/GNUstep/System/Library/Libraries -std=c99 -lobjc -lgnustep-base -fconstant-string-class=NSConstantString

cmd execute

9 Now it will create the “hello.exe” file on that location. To execute the “exe” from cmd just type the file name with extension “hello.exe”
10. Now the screen will show the “Hello World” message.

Result : Hello World

Thank You For your Time!

Leave a Reply

Your email address will not be published. Required fields are marked *