help-gnustep
[Top][All Lists]
Advanced

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

Re: can't compile when add Foundation.h


From: Nicola Pero
Subject: Re: can't compile when add Foundation.h
Date: Thu, 14 Oct 2004 00:34:20 +0100 (BST)

> // GNUstep makefile (gmake) conent works as well:
> include $(GNUSTEP_MAKEFILES)/common.make
> 
> OBJC_PROGRAM_NAME = hello
> hello_OBJC_FILES = main.m
> 
> -include GNUmakefile.preamble
> include $(GNUSTEP_MAKEFILES)/objc.make
> -include GNUmakefile.postamble
> 
> // Now if I modify the original code to start using GNUstep:
> #include <stdio.h>
> #include <Foundation/Foundation.h>
> 
> int main(void)
> {
>   //  NSString *w; // = @"Brainstorm";
>   printf("Hello, World!\n");
>   return 0;
> }
> 
> // I get the following error message, if I run gmake again:
> 
> /usr/lib/crt1.o: In function `_start':
> /usr/lib/crt1.o(.text+0x82): undefined reference to `main'
> collect2: ld returned 1 exit status
> gmake[1]: *** [shared_obj/hello] Error 1
> gmake: *** [hello.all.objc-program.variables] Error 2
> 
> So, I added a simple include statement and main can not be found.

objc.make is for software which is in ObjC but it's not using GNUstep.  If
you are using GNUstep, you should use tool.make ... try --

include $(GNUSTEP_MAKEFILES)/common.make

TOOL_NAME = hello
hello_OBJC_FILES = main.m

include $(GNUSTEP_MAKEFILES)/tool.make

Thanks





reply via email to

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