Help with GCC - part II



Actually, my "hello.c" was wrong (but my system *IS* broken).  In my panic
I wrote 'print' instead of 'printf'.

Now, here is a test-case that shows the problems I'm having.

#include<stdio.h>

#ifdef STANDALONE

int
main ()
{
        printf("Hello world: \n");
        return(0);
}

#endif


When I compile this I get:
$ gcc -Wall testing.c -o testing
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../crt1.o: In function
`_start':
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../crt1.o(.text+0x18):
undefined reference to `main'
collect2: ld returned 1 exit status


If I comment-out the '#ifdef STANDALONE' and '#endif' lines, the program
compiles and runs fine.


Any help would be greatly appreciated.

Daniel.




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