This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Trouble linking to some math functions.
- From: Jason Foat <jfoat at seasoar2 dot ucsd dot edu>
- To: gcc-help at gcc dot gnu dot org
- Date: Mon, 17 Jun 2002 13:02:30 -0700
- Subject: Trouble linking to some math functions.
Hi,
I'm having trouble linking to
very basic math functions. Hopefully,
a wise practioner of gcc can point
in the right direction!
My code this:
//matst.cc
#include <math.h>
int main(int arc, char **argv)
{
double ans;
ans = round( 0.5)
}
Using the compiler directive:
> g++ matst.cc -o matst
I get:
matst.cc : In function `int main(int arc, char **argv)':
matst.cc 8: `nearbyint' undeclared (first use this function)
However, if I change 'nearbyint' to 'fabs' or 'floor', which
appear to be defined at the same location in tgmath.h, then
it will work. `round' also doesn't work.
Thanks!
Jason Foat
UCSD