From: hal@pollux.cs.uga.edu (Hal N. Brooks) Subject: [A] difficulties with libm (was Re: How to GCC part 2) Date: Sat, 17 Apr 1993 06:15:31 GMT
In article <1qm84u$jj1@obelix.uni-muenster.de> zy0004@obelix.uni-muenster.de (Martin Rehwald) writes:
>Hello out there.
>Me again.
>Yesterday I asked for help linking the math-libary using GCC.
>Many told me to use '-lm' instead of '-l m'. I did this before -
>and did not detect any difference in GCC's behaviour.
>Using AIX-GCC on rs6000 both works fine. With me none at all.
>By the way there is another funny observation:
> adding -l m.a causes the error: libm.a not found.
> this should be 'libm.a.a' not found, no?
>If you need further information:
> I'm using GCC-2.3.3, lib4.3.2, Linux-0.99.7
>
>OK.
>Waiting for more ideas,
> MR
>
I didn't see your first post, so I'm assuming a lot about what
your problem is.
Certainly, -lm (at the end of the gcc command line) is the thing to do.
That should allow successful compilation.
If you subsequently get a runtime error message, then you need to
check to see where the symlink /lib/libm.so.4 is pointing. If you're
using libc4.3.2, then it should be made to point to libm.so.4.3.2.
This works for me anyway.
Hopefully HJ won't have to correct me. Others have posted questions
about libm, and his response is usually you need to get libc4.3.x.
But I don't think HJ's instructions say anything about making the
libm.so.4 ---> libm.so.4.3.2 connection. He probably expects more
from some of us than we're capable of delivering! I'm going out on
a limb here, so if I'm wrong HJ, please be gentle with me.
=============================================================================
Hal N. Brooks Voice: (706) 546-7792 Internet: hal@pollux.cs.uga.edu
=============================================================================