M_PI not being found in math.h with gtk



Hi,

Can someone please explain this oddity, or are my libs
messed up.  I have glib-2.12.9  and  gtk+-2.10.8

In normal c, I can 
--------------------------------------
#include <stdio.h>                                                           
#include <math.h>                                                            
                                                                             
int  main (){                                                                
printf("%f\n",M_PI);                                                         
return 0;                                                                    
} 
------------------------------------
Output:
3.141593


However, when I use the gtk libs
----------------------------------------------------------------
#include <math.h>                                                            
#include <gtk/gtk.h>                                                         
                                                                             
int  main (){                           
                                                                    
  g_print("%f\n",M_PI);                                                      
                                                                             
return 0;                                                                    
}  
-------------------------------------------------------------

I get errors
 error: ‘M_PI’ undeclared 


Thanks for the enlightenment,
zentara


-- 
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]