discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can't Get Program To Compile--Help


From: David Chisnall
Subject: Re: Can't Get Program To Compile--Help
Date: Thu, 27 Jan 2011 14:32:14 +0000

On 27 Jan 2011, at 01:23, jokerClay wrote:

> typing gcc -o MyClassMain MyClassMain.m.  I got a simple "Hello World"
> program to compile and run by typing gcc -o MyClass MyClass.m.  I will look
> into making a GNUmakefile.  I didn't realize I need to use gnustep-config. 
> Trying to invoke the compiler myself.  I don't think so.


Okay, that definitely won't work.  If you want to invoke gcc yourself, at the 
minimum, you need to tell it:

- Where to look for GNUstep headers.
- To link against the gnustep-base lib
- (Possibly) to link against the Objective-C runtime library
- (Probably) To predefine some macros that the GNUstep headers expect.

A GNUmakefile will do all of this for you.  Alternatively, you can use 
gnustep-config for simple projects, like this:

gcc `gnustep-config --objc-flags` `gnustep-config --base-libs` -o MyClassMain 
MyClassMain.m

If you're building a gui application, you need to tweak this a bit, but you 
probably won't want to build a gui app that's only in one file and using a 
GNUmakefile is much simpler for nontrivial cases.

David

-- Sent from my PDP-11




reply via email to

[Prev in Thread] Current Thread [Next in Thread]