Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jul 29, 2009, 08:59 AM   #1
SRossi
macrumors regular
 
Join Date: May 2009
Location: Glasgow, Scotland
Objective C on PC :O

Hi all,

Since I just have a mac mini and its a few months till i qualify for educational discounts again I would like to know how to program Objective C on the PC.

I have looked into it a bit and was pointed in the direction of GNUstep, which I downloaded with the GNUcore.

But what I found was that its a bit annoying compiling it in the shell and was wondering if there was a GUI development tool to download to compile Objective C code. I am not wanting it to act like interface builder because I can simply wait and design the interface on my mini.

Even if it was an add on for another GUI compiler on the PC (I have visual studio + Dev-C++) so if there was any add ons that people have used would also help me a lot.

Thanks,

Stephen
__________________
macMini, 2.0 GHz Core 2 Duo, 1 GB RAM, 120GB hd;
Dell S2209W 21.5" monitor;
iPhone 4GS 16GB;
30 GB iPod video;
SRossi is offline   0 Reply With Quote
Old Jul 29, 2009, 09:44 AM   #2
foidulus
macrumors 6502a
 
Join Date: Jan 2007
Quote:
Originally Posted by SRossi View Post
Hi all,

Since I just have a mac mini and its a few months till i qualify for educational discounts again I would like to know how to program Objective C on the PC.

I have looked into it a bit and was pointed in the direction of GNUstep, which I downloaded with the GNUcore.

But what I found was that its a bit annoying compiling it in the shell and was wondering if there was a GUI development tool to download to compile Objective C code. I am not wanting it to act like interface builder because I can simply wait and design the interface on my mini.

Even if it was an add on for another GUI compiler on the PC (I have visual studio + Dev-C++) so if there was any add ons that people have used would also help me a lot.

Thanks,

Stephen
Objective-c yes, Cocoa, kind of.

Like you have already found out, GCC supports objective c, however it does not yet support Objective-c 2.0(with automatic GC among other things). GNUStep is an attempt to implement all the Cocoa features with GCC, but be warned it's pretty far behind where Apple is(and is going)

Keep in mind that if you want to test your code on the mac, you are going to have to make sure to tell gcc to make Mach binaries as they are probably(unless you are using Darwin :P) not the default executable type on your machine.

Ultimately, you really should consider using the mac mini for development. It can run all the fun tools, will definitely produce mac binaries, and is guaranteed to have all the features you need.
foidulus is offline   0 Reply With Quote
Old Jul 29, 2009, 10:40 AM   #3
mags631
Guest
 
Join Date: Mar 2007
Quote:
Originally Posted by SRossi View Post
Hi all,

Since I just have a mac mini and its a few months till i qualify for educational discounts again I would like to know how to program Objective C on the PC.
As stated previously, the Mini is more than adequate for Objective C development. (My first Mini, a single core model, was purchased for development.)

Quote:
I have looked into it a bit and was pointed in the direction of GNUstep, which I downloaded with the GNUcore.

But what I found was that its a bit annoying compiling it in the shell and was wondering if there was a GUI development tool to download to compile Objective C code. I am not wanting it to act like interface builder because I can simply wait and design the interface on my mini.

Even if it was an add on for another GUI compiler on the PC (I have visual studio + Dev-C++) so if there was any add ons that people have used would also help me a lot.
Unless you are just experimenting, you will likely be disappointed by the Objective C tools offered on Windows. Cygwin and Minwin are good places to start. While I have used gcc on both Cygwin and Minwin (including compiling objective c files), I did not try to integrate it into Visual Studio. If you happen to figure out how to do it, you should write it up and post it somewhere for the next person!
mags631 is offline   0 Reply With Quote
Old Jul 29, 2009, 11:34 AM   #4
SRossi
Thread Starter
macrumors regular
 
Join Date: May 2009
Location: Glasgow, Scotland
Having a little look around on the web and having a look at dev c++ website I have found out that it is actually built using the GCC compiler so therefore it SHOULD compile and run Objective-C code but not 2.0. Well not as far as I know, if someone could explain why I'm all ears because I thought that 2.0 was also built upon the GCC compiler.

I'll let you know how I get on with Dev C++.

Thanks for the tips soo far.

Stephen

EDIT: Right I have set up Dev C++ (beta version) and just trying a "Hello World" app and I am wondering how Dev C++ allows you to import other header files because I am trying to use the Foundation.h file located in the GNUstep files that I downloaded yesterday. Any help would be appreciated and im sure that other people will hopefully also be able to use this thread as well.
__________________
macMini, 2.0 GHz Core 2 Duo, 1 GB RAM, 120GB hd;
Dell S2209W 21.5" monitor;
iPhone 4GS 16GB;
30 GB iPod video;

Last edited by SRossi; Jul 29, 2009 at 12:08 PM.
SRossi is offline   0 Reply With Quote
Old Jul 29, 2009, 05:39 PM   #5
mongrol
macrumors regular
 
Join Date: Jul 2007
Quote:
Originally Posted by SRossi View Post

EDIT: Right I have set up Dev C++ (beta version) and just trying a "Hello World" app and I am wondering how Dev C++ allows you to import other header files because I am trying to use the Foundation.h file located in the GNUstep files that I downloaded yesterday. Any help would be appreciated and im sure that other people will hopefully also be able to use this thread as well.
including header files is a language function. It's not specific to an IDE. Put this at the top of your .c file

#include "foundation.h"

I suggest reading through either the gnustep docs or more appropriately, the official Objective-C Programming Guide on the Apple developer site.
mongrol is offline   0 Reply With Quote
Old Jul 30, 2009, 04:03 AM   #6
SRossi
Thread Starter
macrumors regular
 
Join Date: May 2009
Location: Glasgow, Scotland
Yeah I understand how to include a file into it but what I am meaning is that the files are held else where and when I include them I am getting a compile error that they cannot be found. I have added the folder where they are contained into the Compile Options -> Directory and copied it into the Binaries, Libraries, C and C++ subfolders.

Ill try again today to get it working though .

Stephen

EDIT: Also Dev C++ also will not save the file as a .m file, this may also be the case as in why it wont find the included file, would saving it as .c make any difference?
__________________
macMini, 2.0 GHz Core 2 Duo, 1 GB RAM, 120GB hd;
Dell S2209W 21.5" monitor;
iPhone 4GS 16GB;
30 GB iPod video;
SRossi is offline   0 Reply With Quote
Old Jul 30, 2009, 05:47 PM   #7
mongrol
macrumors regular
 
Join Date: Jul 2007
Hmm, Dev C++ is quite old. Does it have any support for Objective-C at all? I know theoretically it should work since it's the compiler that matters but you don't want the IDE fighting against you. Have you looked at Code::Blocks IDE? It appears to support ObjC.
mongrol is offline   0 Reply With Quote
Old Jul 30, 2009, 06:04 PM   #8
SRossi
Thread Starter
macrumors regular
 
Join Date: May 2009
Location: Glasgow, Scotland
Theoretically it should, even says in the docs that it will work but contradicts its self but saying not supported.

Yeah I had looked a little into Code::Blocks but I thought it looked absolutely cluttered, there was too many things happening at once, but I am thinking that it could be the only way unless using MinGW, which is a pain to install (I've tried and failed a few times now).

Thinking the best to do is us VIM to create the file then just use the GNUstep shell to compile it, but I absolutely hate using Command Prompt or shells on Windows.

Tomorrow I'm going to look into which packages can be downloaded for Visual Studio, because im sure I read somewhere that Objective-C was included in a package which made it completely supported.

I'll keep trying anyway, thanks for everyones help but I've not finished yet more help would be great

Stephen
__________________
macMini, 2.0 GHz Core 2 Duo, 1 GB RAM, 120GB hd;
Dell S2209W 21.5" monitor;
iPhone 4GS 16GB;
30 GB iPod video;
SRossi is offline   0 Reply With Quote
Old Jul 30, 2009, 06:11 PM   #9
munkees
macrumors 65816
 
munkees's Avatar
 
Join Date: Sep 2005
Location: Pacific Northwest
Quote:
Originally Posted by foidulus View Post
GNUStep is an attempt to implement all the Cocoa features with GCC.
GNUStep been around longer then cocoa, GNUStep is GNU version of openstep, which is based on NeXTstep. Cocoa is Apple modified modernised version of NeXTstep.

you could say GNUStep is the sibling of Cocoa, and that NeXTstep is the parent.
__________________
iMacs, MBA and iPhone.
munkees is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
I Need Help Learning Objective-c!! Woodshark69 Mac Programming 11 Dec 14, 2012 07:21 AM
Objective C Accessors ag2web Mac Programming 9 Nov 18, 2012 02:53 PM
Problems with Objective-C++? frank100 Mac Programming 5 Aug 8, 2012 04:49 PM
Testing objective-c Evre iPhone/iPad Programming 21 Jul 12, 2012 07:22 AM
Objective C Syntax nashyo iPhone/iPad Programming 6 Jul 4, 2012 11:56 AM

Forum Jump

All times are GMT -5. The time now is 05:14 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC