[mercury-users] linker error

Fergus Henderson fjh at cs.mu.OZ.AU
Tue May 13 03:11:41 AEST 2003

On 12-May-2003, mauro_c2r at libero.it <mauro_c2r at libero.it> wrote:
> I have downloaded Mercury 0.11.0 on my system running Mandrake Linux 9.0

Which distribution of Mercury did you use?  The source distribution,
or one of the binary distributions, and if the latter, which one?

> When I try to compile my first program (hello_world.m from the tutorial) the linker reports this 
> error:
> $ mmc -v hello_world.m
> % Parsing file `hello_world' and imported interfaces...
> [...]
> % Linking...
> % Invoking system command `ml --grade asm_fast.gc --mercury-standard-library-directory 
> /usr/local/mercury-0.11.0/lib/mercury  -L/usr/local/mercury-0.11.0/lib/mercury/lib/asm_fast.
> gc/i686-pc-linux-gnu -- -o hello_world hello_world_init.o hello_world.o    '...
> % done.
> /usr/bin/ld: cannot find -lm

There's two likely possibilities here: either Mandrake Linux has a libm, but
you haven't installed it, or Mandrake Linux has incorporated libm into libc,
but you used a binary distribution of Mercury that was built on a different
version of Linux.

Try setting the MERCURY_MATH_LIB environment variable to the empty string,
e.g. in bash


That should stop it trying to link against `-lm'.
If this results in errors about some math functions being undefined,
then you'll need to figure out which Mandrake package contains
libm and install it.

Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe

More information about the users mailing list