gcc 4.3pre (20070824) vs. gmp.h: error: std::FILE has not been declared
Michael Abshoff
Michael.Abshoff at fsmath.mathematik.uni-dortmund.de
Sun Aug 26 02:24:18 CEST 2007
Hello,
I ran into the following problem when compiling the following AC_CHECK
snippet with gcc 4.3pre (20070824 snapshot) when using gmp release 4.2.1:
[mabshoff at m940 src]$ cat gmp-version-check.c
#include <gmp.h>
int main ()
{
if (__GNU_MP_VERSION < 4)
return -1;
else
return 0;
}
[mabshoff at m940 src]# g++ -I ../../../../local/include/ gmp-version-check.c
-lgmp
In file included from gmp-version-check.c:1:
../../../../local/include/gmp.h:515: error: std::FILE has not been declared
(the code compiled fine with gcc, because the offending bit is ifdefd with
__cplusplus). Removing the offending "using std::FILE" make the code in
question (which originated in the AC_CHECK of givaro) and givaro itself (a
C++ library for arithmetic and algebraic computations) compile. But the
sample problem should show up in any C++ libary or code including gmp.h
Now my questions:
- Is that the recommended work-around or am I doing something wrong?
- I have to admit my ignorance: Why are we using "using std::FILE" there?
Is it even needed for g++?
Cheers,
Michael
More information about the gmp-bugs
mailing list