From 16e131e6f8d37795bbbb64ee0a58db378f55a948 Mon Sep 17 00:00:00 2001 From: simonmar Date: Tue, 16 Oct 2001 11:29:08 +0000 Subject: [PATCH] [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. --- ghc/docs/users_guide/phases.sgml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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. -- 1.7.10.4