From: simonmar Date: Tue, 16 Oct 2001 11:29:08 +0000 (+0000) Subject: [project @ 2001-10-16 11:29:08 by simonmar] X-Git-Tag: Approximately_9120_patches~828 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=16e131e6f8d37795bbbb64ee0a58db378f55a948;p=ghc-hetmet.git [project @ 2001-10-16 11:29:08 by simonmar] mention that you might need to add -lHSrts before any other libraries on the linker command line, if another library has its own main() function. --- diff --git a/ghc/docs/users_guide/phases.sgml b/ghc/docs/users_guide/phases.sgml index 01ac535..3454483 100644 --- a/ghc/docs/users_guide/phases.sgml +++ b/ghc/docs/users_guide/phases.sgml @@ -299,6 +299,22 @@ strmod = "\ come before bar on the command line. + + There's one other gotcha to bear in mind when using + external libraries: if the library contains a + main() function, then this will be + linked in preference to GHC's own + main() function + (eg. libf2c and libl + have their own main()s). This is + because GHC's main() comes from the + HSrts library, which is normally + included after all the other + libraries on the linker's command line. To force GHC's + main() to be used in preference to any + other main()s from external libraries, + just add the option before any + other libraries on the command line.