Re: Help with GCC - part II



Hi,

you check for "STANDALONE" without having ever defined it. That's why
everything between "#ifdef STANDALONE" and "#endif" is ignored, so the
linker doesn't know anything about your main()-function, because there
is no main()-function. This is why you get the linker-error.
You should define STANDALONE ( "#define STANDALONE" ) to make the
precompiler don't ignore the main()-function. If you do this your linker
knows about main()-function and everything seems to be fine. :o)
If you think your System is broken, please send me an output of the
errormessages that makes you think, your system ist broken. Mybe I can
point out the mistake.

Love & lIght

DK


Try the following:
----------------------------------
#include<stdio.h>

#define STANDALONE

#ifdef STANDALONE

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

#endif
----------------------------------



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