[huskerlug] Re: Makefile question

  • From: "J.R. Wessels" <jwessels@xxxxxxxxxxx>
  • To: huskerlug@xxxxxxxxxxxxx
  • Date: Wed, 7 Aug 2002 04:41:49 -0500

Perhaps it is redefineing the main function name to something else to include 
it in a wrapper of its own. Example:

int usermain(int argc,char*argv[]); // prototype for your main

int main(int argc, char * argv[])
{
        do setup stuff here
        int value = usermain(argc, argv);
        do closedown stuff here
        return value;
}

Then in an include file you put in your program, but not the above...

#define main usermain

The above is probably wrong somehow, but you get the idea.  I got this idea 
from the Wine does this to wrap around the winmain function when compiling in 
Linux, and I got this error when not including the Wine main fuction stub.

On Tuesday 06 August 2002 6:13, you wrote:
> I'm trying to build an executable from some code I wrote that uses a
> large high energy physics toolkit called GEANT4.  The toolkit is complex
> and really requires one to use their makefiles.  When I do a make,
> everything compiles (FINALLY) but when it tries to link I get the 'well
> known':
> /usr/lib/gcc-lib/i586-mandrake-linux-gnu/2.96/../../../crt1.o: In
> function `_start':
> /usr/lib/gcc-lib/i586-mandrake-linux-gnu/2.96/../../../crt1.o(.text+0x18):
> undefined reference to `main'
>
> WHY IN GODS NAME DOES IT DO THAT?
>
> (Yes, I have a main()).
>
> Is there ANYTHING I could post that would allow someone here to help me?
>
> Carl Lundstedt
> UNL
>
>
> ----
> Husker Linux Users Group mailing list
> To unsubscribe, send a message to huskerlug-request@xxxxxxxxxxxxx
> with a subject of UNSUBSCRIBE

-- 

J.R. Wessels
jwessels@xxxxxxxxxxx

----
Husker Linux Users Group mailing list
To unsubscribe, send a message to huskerlug-request@xxxxxxxxxxxxx
with a subject of UNSUBSCRIBE


Other related posts: