Problems with main in a lib*.a. Is that a bug?

Simon Marlow simonmar@microsoft.com
Thu, 12 Dec 2002 14:00:25 -0000


> Ok, I have made a "ghc -v"and see the problem :
>=20
> * on OS X, a SDL program must have a main function supplied=20
> by a lib :=20
> libSDLmain.a
> * This is achieved by adding -lSDLmain at the command line.
>=20
> * libHSrts.a supply a main. My program is linked against this=20
> lib by a -lHSrts.
>=20
> ld is called by ghc with args :
> [...] lHSrts [...] -lSDLmain [...]

Hmm, I just checked the source, and GHC definitely calls the linker
passing any -l options from the command line *before* -l options from
packages (-lHSrts comes from the rts package).  And I just tried a small
example with -lfoo on the command line, and it does indeed come before
-lHSrts.

So could you post *exactly* what you're doing, the full command lines
and the full output from ghc -v so we can see what's going wrong.

Cheers,
	SImon