Problem with math.h
David Korn
dkorn@pixelpower.com
Thu Feb 15 09:17:00 GMT 2001
Hi Pablo, Amos,
[ I assume you two guys know each other since you have email addresses in
the same domain and reported the same problem within a few moments of each
other! ]
>Dear GNU help desk:
We're not really a help desk. We're just subscribers to the mailing list.
Some people here are members of the Gcc development teams at Cygnus and
Code Sourcery, others are just amateur hackers or end users. Still glad
to help, if we can.
> While trying to compile an ANSI C source code I
>constantly get the 'Undeclared identifier' error for any math
>function. The same source code compiled properly under a different
>operating system (under strict ANSI).
> Both header files 'math.h' and 'bits/mathcalls.h' are
>present in
>the include folder. What is wrong?
Good question, and not one that can be easily answered by taking a guess
from half-way round the planet. Good bug reports should include full
details of the system you are using (what OS and CPU), which version of the
compiler you're using (the output from gcc -v tells you), the *exact* text
of the error message in question, the *exact* command line you used to start
the compiler with, and if at all possible a few lines of cut and paste from
the code showing where the error is.
So give this test case a try:
------mtest.c--------------
#include <math.h>
int main(void)
{
double n;
n = sqrt(2);
return (int)n - 1;
}
----------------------------
Cut and paste it into a file 'mtest.c' and try building it with the
command line
gcc -v mtest.c -o mtest
and capture the output into a text file. Then post all the output back to
the list. If that doesn't tell us enough, we'll also need to try
gcc -v mtest.c -o mtest.i -E
to have a look at the pre-processed source code.
cheers,
DaveK
--
we are not seats or eyeballs or end users or consumers.
we are human beings - and our reach exceeds your grasp.
deal with it. - cluetrain.org
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.
www.mimesweeper.com
**********************************************************************
More information about the Gcc-help
mailing list