Commit 16e131e6 authored by simonmar's avatar simonmar
Browse files

[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.
parent 35d7d23c
......@@ -299,6 +299,22 @@ strmod = "\
come <emphasis>before</emphasis>
<option>-l</option><replaceable>bar</replaceable> on the
command line.</para>
<para>There's one other gotcha to bear in mind when using
external libraries: if the library contains a
<literal>main()</literal> function, then this will be
linked in preference to GHC's own
<literal>main()</literal> function
(eg. <literal>libf2c</literal> and <literal>libl</literal>
have their own <literal>main()</literal>s). This is
because GHC's <literal>main()</literal> comes from the
<literal>HSrts</literal> library, which is normally
included <emphasis>after</emphasis> all the other
libraries on the linker's command line. To force GHC's
<literal>main()</literal> to be used in preference to any
other <literal>main()</literal>s from external libraries,
just add the option <option>-lHSrts</option> before any
other libraries on the command line.</para>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment