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
_______________________________________________
Help-gnustep mailing list
[EMAIL PROTECTED]
http://lists.gnu.org/mailman/listinfo/help-gnustep

Reply via email to