Undefined references

Robert Lunnon bobl at optushome.com.au
Wed Oct 5 06:46:21 CDT 2005


On Wednesday 05 October 2005 21:09, Alexandre Julliard wrote:
> Robert Lunnon <bobl at optushome.com.au> writes:
> > Under solaris I get some undefined references popping up from yesterdays
> > cvs (that I'm not used to seeing).
> > Undefined                       first referenced
> >  symbol                             in file
> > GetStartupInfoA                     ../../dlls/libwinecrt0.a(exe_main.o)
> > GetModuleHandleA                    ../../dlls/libwinecrt0.a(exe_main.o)
> > GetCommandLineA                     ../../dlls/libwinecrt0.a(exe_main.o)
> > WinMain                             ../../dlls/libwinecrt0.a(exe_main.o)
> >
> > I'm used to seeing main  undefined in libraries (presumably because the
> > abblications using the dlls define the symbol), but not this collection. 
> > the wine executable fails with
>
> If main() is undefined then the new winecrt0 will define it and bring
> in these symbols. It sounds like there is a problem with the link
> command, main() shouldn't be referenced at all when building dlls.

Aha, I understand, on SysV winegcc adds -Wl,-G to link a shared library but 
doesn't add -shared so gcc (which doesn't know about the linker commands 
includes the c runtime startoff crt0.o which of course defines main, so the 
linker dutifully includes main in the shared library.

Not good

Bob



More information about the wine-devel mailing list