This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]