[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
can't compile when add Foundation.h
From: |
bazad |
Subject: |
can't compile when add Foundation.h |
Date: |
Wed, 13 Oct 2004 15:31:51 -0700 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Reasonable Discussion, berkeley-unix) |
Hi,
I am able to compile and run a simple example:
// main.m file content:
#include <stdio.h>
int main()
{
printf("Hello, world!\n");
return 0;
}
// makefile on FreeBSD
default:
gcc -c -Wno-import main.m
gcc -o hello -Wno-import main.o -lobjc
// 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.
Thank you
- can't compile when add Foundation.h,
bazad <=