Re: [mercury-users] linker error

mauro_c2r@libero.it mauro_c2r at libero.it
Tue May 13 18:41:58 AEST 2003


I use the source distribution, installed simply:
./configure
make
make install
make clean

The environment variable MERCURY_MATH_LIB was not set! So I set it to:
export MERCURY_MATH_LIB="/usr/lib/libm.so"
But now I get another error: 
/usr/bin/ld: cannot find -lc

Where are set these environment variables? If I do
$ printenv
I can't see any MERCURY_xyz variable set (except the one I set before in ./bashrc)

Thanks
Mauro



> 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
> 
> 	export MERCURY_MATH_LIB=''
> 
> 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        
.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
> --------------------------------------------------------------------------
> 

--------------------------------------------------------------------------
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