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

Hello, I am building a SDL binding on MacOS X (but the same problem should appears on Windows). It defines it's own main function in a libSDLmain.a. But I can't get ghc not to generate a main when linking with -lSDLmain, which is the option that is indicated to get the main function that make SDL usable. when I link write : ghc -o test Main.hs libSDLmain.a , ghc doesn't generate a main as it can see there is a main in libSDLmain. And my test programs works. but when I write ghc -o test Main.hs -lSDLmain, ghc creates its own main, and it doesn't work. The first solution is not convenient as the standard way of getting parameter is "sdl-config" which gives back the second types of argument. -no-hs-main don't change anything on this point. Is there a flag saying ghc not to generate a main? Cheers, Nicolas Oury

On Tue, Dec 10, 2002 at 05:25:46PM +0100, Nicolas Oury wrote:
but when I write
ghc -o test Main.hs -lSDLmain, ghc creates its own main, and it doesn't work.
Probably a stupid question, but if SDL supplies its own main
function, then you don't have to put your functions in a module
called Main ...? (i.e. rename your Main module to something
else random, like Foo)
--
#ozone/algorithm
participants (2)
-
Andre Pang
-
Nicolas Oury