Learning Objective C in the Windows Environment - Creating "Hello World" app

by 28. January 2011 21:29

You can have a "free" environment setup within a few minutes that will allow you to start learning how develop in Objective C.   This is not the optimal setup but it will get you started while you are waiting (as I am) to setup my Apple development environment.

Note: The GNUStep console window is used solely to compile your console application, we'll use the JEdit editor to create our first "Hello World" application.   Once compiled you can execute your application from the command prompt.

You'll need to download three installation files from the following site:

http://www.gnustep.org/experience/Windows.html

I selected "HTTP Access" which took me to the following link:

http://ftpmain.gnustep.org/pub/gnustep/binaries/windows/

Where I downloaded the following three files and installed them in the order shown.  

After installing the above three files I downloaded JEdit from the following link:

http://jedit.org/index.php?page=download

When I first ran the "Shell" on my Intel x64 I7 I just saw a blip on the screen (command window opening and closing).

I opened the msys.bat file and debugged it to the highlighted line below.  I updated the batch file to launch the Console and Jedit

Now when I launch the menu option I see the following two windows open:

I added the following lines of code to the Jedit window and saved it as HelloWorld.m  

#include <stdio.h>
int main(void)
{
        printf("Hello, World!");
        return ;
}
 
I then went my Console (window with black background) and typed in the following:

gcc - helloworld.m -o helloworld

Did a Dir to see the directory results (and found my helloworld.exe) and then ran it

Notice

Blog videos and references to CodePlex projects are no longer valid