OT: gcc math library
Charles Hallenbeck
hallenbeck at valstar.net
Thu Sep 5 09:16:25 EDT 2002
Thanks, Kerry;
I was led astray by the fact that it was not needed when the G++
compiler was run.
Chuck
On Thu, 5 Sep 2002, Kerry Hoath wrote:
> This is easy;
> add -lm to the link step.
> You must link against libc and libm and you do that
> with -lm on the linking step.
> Check sox makefile for an example of this or any good C book.
>
> Regards, Kerry.
>
> On Thu, Sep 05, 2002 at 08:09:18AM -0400, Charles Hallenbeck wrote:
> > I hope someone may have some quick advice for me on this one.
> >
> > I have routinely been using the G++ compiler in my programming,
> > and have recently rewritten some of my code in normal C instead
> > of C++ for reasons of efficiency and portability. The rewrite was
> > not difficult, and I finally got one package of about 2000 lines
> > of code to compile without errors or warnings. However - the
> > linking step failed when none of the math functions required in
> > the program could be located by the GCC linker. The same
> > functions in the C++ version compiled by G++ were found with no
> > problem. The functions were: sqrt, log, log10, trunc, int,
> > double, float, etc. The header file math.h was present (without
> > it, compile errors result) but evidently the C math library could
> > not be found.
> >
> > I tried reinstalling my gcc.tgz and glibc.tgz packages to no
> > avail. I am now heading for the howto's and docs to see what I
> > can learn. Any help from you programmers out there would be
> > greatly appreciated.
> >
> > My system: Slackware 8.0, kernel 2.4.18, GCC 2.95.3
> >
> > Thanks - Chuck
> >
> > --
> > The Moon is Waning Crescent (4% of Full)
> > So visit me at http://www.valstar.net/~hallenbeck
> >
> >
> > _______________________________________________
> > Speakup mailing list
> > Speakup at braille.uwo.ca
> > http://speech.braille.uwo.ca/mailman/listinfo/speakup
> >
>
>
--
The Moon is Waning Crescent (4% of Full)
So visit me at http://www.valstar.net/~hallenbeck
More information about the Speakup
mailing list