help-gnustep
[Top][All Lists]
Advanced

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

Re: YellowDog Linux on G4 compiling basic ObjC program


From: Fred Kiefer
Subject: Re: YellowDog Linux on G4 compiling basic ObjC program
Date: Thu, 03 Jun 2004 23:59:54 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040114

Vladimir Leven wrote:
Hi,

I can't figure out how to compile a simple ObjC program on Yellow Dog Linux. My main.m looks like

#import <Foundation/Foundation.h>
int main(int argc, const char *argv[]) {
   NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
   NSLog(@"all tests passed");
   [pool release];
   return 0;
}

and my GNUmakefile like

include $(GNUSTEP_MAKEFILES)/common.make
TOOL_NAME=mtest
string_OBJC_FILES = mtest.m

This is the line that is causing you trouble.
The name of your tool is "mtest", but you specify the file that would
constitute a tool names "string". Replacing this with

mtest_OBJC_FILES = mtest.m

should work


include $(GNUSTEP_MAKEFILES)/tool.make

make produces:

Making all for tool mtest...
Linking tool mtest ...
/usr/lib/crt1.o(.rodata+0x4): undefined reference to `main'
collect2: ld returned 1 exit status
make[1]: *** [shared_obj/mtest] Error 1
make: *** [mtest.all.tool.variables] Error 2

What am I doing wrong?
And actually, I would be even more interested in how to build my test program directly with gcc. I'm considering using ObjC/GnuStep-Base for embedded development and would prefer not to use the supplied makefiles.


To see the actual gcc command you have to switch on the verbose mode by doing:
make messages=yes




reply via email to

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