gcc -lm and libm.a for Mac OS X

Vincent Lemaitre vincent.lemaitre@bioch.ox.ac.uk
Tue Nov 11 16:31:00 GMT 2003


Hi,

When running the following command:
gcc -lm test_isnan.cc

I got the following error message:

ld: Undefined symbols:
___gxx_personality_v0

The libm.a is missing in /usr/lib. And I suspect this is (part of) the 
reason of the reason for the error.

Could somebody explain me where and how to get libm.a under Mac OSX? Or 
is there another way to link the math library?

The gcc man page on Apple web site takes it for granted that libm.a 
should be in /usr/local, but it is not. The only library that could be 
a math library is libm.dylib@...
(I have installed the Apple's Developper's Tools and all the C 
libraries I could find with fink, without success).

Thank you in advance,

Vincent





test_isnan.cc:

#include <stdio.h>
#include <math.h>

int main()
{

   printf("Hello it's test program for isnan()\n");

   printf(" \"3000\" is a NUMBER?\t: %d\n",isnan(3000.0));

   return 1;
}



More information about the Gcc-bugs mailing list