The compiler's C++ headers do not appear to work properly on AIX when the compiler is run with -D_LARGE_FILES. This macro causes the system headers to #define symbols like fopen, while the C++ headers unconditionally #undef these symbols.
Environment: System: AIX bigblue 2 5 000F699D4C00 host: powerpc-ibm-aix5.2.0.0 build: powerpc-ibm-aix5.2.0.0 target: powerpc-ibm-aix5.2.0.0 configured with: /usr0/slammert/gcc-3.4.3/configure --with-as=/usr/bin/as --with-ld=/usr/bin/ld --disable-nls --enable-languages=c,c++ --enable-threads --enable-version-specific-runtime-libs How-To-Repeat: On AIX 5.2, compile the following program with 3.4.3 g++ -D_LARGE_FILES: #include <iostream> int main(void) { return 0; } You will get output similar to the following: In file included from /usr/local/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.3/include/c++/powerpc-ibm-aix5.2.0.0/bits/c++locale.h:43, from /usr/local/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.3/include/c++/iosfwd:46, from /usr/local/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.3/include/c++/ios:44, from /usr/local/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.3/include/c++/ostream:45, from /usr/local/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.3/include/c++/iostream:45, from bug0.C:1: /usr/local/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.3/include/c++/cstdio:108: error: `::fgetpos' has not been declared /usr/local/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.3/include/c++/cstdio:110: error: `::fopen' has not been declared /usr/local/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.3/include/c++/cstdio:115: error: `::freopen' has not been declared /usr/local/lib/gcc/powerpc-ibm-aix5.2.0.0/3.4.3/include/c++/cstdio:118: error: `::fsetpos' has not been declared ------- Additional Comments From dsanderson at panasas dot com 2005-03-07 19:12 ------- Fix: I can work around this problem and still compile a program with a 64-bit off_t by compiling with -maix64 instead of -D_LARGE_FILES. -- Summary: AIX g++ -D_LARGE_FILES fails to compile #include <iostream> Product: gcc Version: 3.4.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: dsanderson at panasas dot com CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: powerpc-ibm-aix5.2.0.0 GCC host triplet: powerpc-ibm-aix5.2.0.0 GCC target triplet: powerpc-ibm-aix5.2.0.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20366