Re: M_PI not being found in math.h with gtk
- From: zentara <zentara1 sbcglobal net>
- To: gtk-list gnome org
- Subject: Re: M_PI not being found in math.h with gtk
- Date: Thu, 1 Feb 2007 17:54:38 -0500
On Thu, 01 Feb 2007 22:29:17 +0000
Ed Catmur <ed catmur co uk> wrote:
>> I get errors
>> error: ‘M_PI’ undeclared
>
>Works fine here. Which libc are you using? What compiler flags?
>
>Ed
Dang, I found the problem, but it still poses another question.
I've been using this little shell script to compile and it causes the failure
because it has the -ansi option. I've been using it so long in my normal
c I never questioned it.
#!/bin/bash
file=${1%.c} #remove .c if present
cfile=${file}.c #add .c back to file
gcc -ansi -pedantic -W -Wall -O2 -o $file $cfile `pkg-config --cflags --libs gtk+-2.0`
# works without the -ansi
#gcc -pedantic -W -Wall -O2 -o $file $cfile `pkg-config --cflags --libs gtk+-2.0`
strip $file
exit
Thanks for the prompt to look at my compile. But now the question
is "why does ansi knock it out" ? Do the Gtk libs need to be given
a "configure with ansi", or what?
Thanks,
zentara
P.S. My libc:
zentara@:zentara$ ./libc-2.3.6.so
GNU C Library stable release version 2.3.6, by Roland McGrath et al.
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.0.2.
Compiled on a Linux 2.6.10-za system on 2005-11-07.
Available extensions:
GNU libio by Per Bothner
crypt add-on version 2.1 by Michael Glad and others
GNU Libidn by Simon Josefsson
Native POSIX Threads Library by Ulrich Drepper et al
BIND-8.2.3-T5B
NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
Thread-local storage support included.
For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>.
--
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]