Amazon.com Widgets compiling & running exercises under MS Windows?
Welcome, Guest. Please login or register.
Did you miss your activation email?
June 19, 2013, 03:16:21 AM
Home Help Search chat Login Register   
News: Read this please.The Great Kangaroo Escape Looking for reviews of the 4th ed on Amazon!   Twitter:  @skochan
                     

+  Official Forum for Programming in Objective-C (the iPhone Programming Language) - Stephen Kochan
|-+  Old Stuff
| |-+  Help!!!
| | |-+  compiling & running exercises under MS Windows?
Pages: [1]   Go Down
Print
Author Topic: compiling & running exercises under MS Windows?  (Read 2618 times)
hdelman
Newbie
*
Posts: 21






« on: March 16, 2009, 03:14:17 PM »

I know I will need to develop my "real" apps on a Mac, but is there a reasonable way to use a PC to compile and run the exercises in the book?

My desktop PC is integrated, networked, and otherwise totally incorporated into my engineering life, including my comfortable chair, desk, and giant monitor.  My little Mac notebook is lonely, and never quite fits where I want it.  <G>

Howard
Logged
skochan
Administrator
Hero Member
*****
Posts: 3109







« Reply #1 on: March 16, 2009, 04:55:26 PM »

Howard,

It's literally been years since I've tried compiling Objective-C under Windows.  In fact, the first edition of the book was OS-neutral, as I was hoping that Objective-C might become a language that was used for application development on systems other than the Mac.

I've attached an overview on compiling Objective-C programs under Windows.  This is from the first edition of the book and as noted, has not been tested in years.   Other than that, try Google and look at CygWin and minGW, which are mentioned in the attachment.

Good luck!

Cheers,

Steve Kochan

« Last Edit: May 21, 2009, 09:50:35 AM by skochan » Logged
blessed
Newbie
*
Posts: 4


Email




« Reply #2 on: July 23, 2009, 09:46:23 AM »

Hello I think I can help you I just got my Macbook pro and I had to run the programs in windows. 
1.  you have to download the program from here http://www.gnustep.org/experience/Windows.html download and install the programs in the order that is says on that web page.
2.  when you install your program you are going to need a text editor to create your programs you can use windows notepad or download a program called notepad++ I like notepad++.
3. once you have typed your program and saved it as a text ansi file  (ie myprogram.m)  make sure you have the dot m extension. You have to fire up the program you downloaded from step one.  Now it took me months to find out how to get this to work on my machine, but when I wanted to compile my program I had to input this on the command line you will see what I mean when you run the program.
gcc `gnustep-config --objc-flags` -o hello hello.m -L c:/GNUstep/GNUstep/System/Library/Libraries -lobjc -lgnustep-base

where i have -o hello that will be the name of your executable file and hello.m is the name of your file.  If this does not make sure you have typed it in correctly.
I run windows xp and this worked for me.
Logged
BeSweeet
Newbie
*
Posts: 14


WWW Email




« Reply #3 on: July 27, 2009, 10:20:00 AM »

You could always turn your PC into a hackintosh. Really easy and completely legal.

Just a though.
Logged

Check out my small tech/personal blog: http://thesweetblog.co.cc
kevindavies1
Newbie
*
Posts: 1






« Reply #4 on: September 17, 2009, 03:30:12 AM »

There is an easier way of compiling programs using GNUStep....use a Makefile.
You need to create a file called 'GNUmakefile' and put it in the same directory as your source code files. The GNUmakefile takes the format shown below: -

include $(GNUSTEP_MAKEFILES)/common.make


TOOL_NAME = ProgramName
ProgramName_OBJC_FILES = ProgramName.m Fraction.m
ErrorHandling_HEADER_FILES = Fraction.h

include $(GNUSTEP_MAKEFILES)/tool.make


ProgramName will usually be the same name as your main .m file
_OBJC_FILES is the list of .m files your program uses
_HEADER_FILES is the list of .h files your program uses.

Once you have your GNUmakefile and all your source code ready you can compile your program from the GNUStep command prompt using the command 'make YourProgramName', be careful it is case sensitive.

That’s all there is to it, much easier that typing long compilation lines into the GNUStep command prompt.

A few warnings about GNUStep......it does not yet support the @property or @synthesize so you will need to write your own 'Getters' and 'Setters', which is not a big deal!

I am up to chapter 10 in the book now (great book  Stephen!) and have managed to compile all the programs up to now. Of course you will need OSX / XCode for some of the later chapters on the IPhone stuff.

I have a 'Hackintosh' netbook which lets me run XCode but I don't always have it with me so being able to compile the programs on a Windows PC is very useful.
Anyway, I hope this is useful to some of you, the forum has already been very helpful for me and I only joined a few days ago!
Logged
Pages: [1]   Go Up
Print
Jump to:  



Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Entire forum contents (c) 2009 classroomM.com. All rights reserved.