This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Largefile problem with gcc3.0.2
- To: gcc-bugs at gcc dot gnu dot org
- Subject: Largefile problem with gcc3.0.2
- From: wilf at techco dot ab dot ca
- Date: Tue, 30 Oct 2001 13:27:42 -0700
- Organization: Techco Geophysical
Hi,
I've recently installed the latest release of the GNU compiler collection and
have discovered a rather nasty and mysterious problem. Due to this, I've reverted
back to 2.95.3
I commonly access binary data files > 2 Gig's and have been enabling large
file support using -D_FILE_OFFSET_BITS=64. I've found that if I add the
line #include <fstream> to a c++ source file, but mix this with a call to
fopen, largefile support disappears (nm shows fopen being referenced in the
object rather than fopen64). My operating system is Solaris 2.8.
The following reports an error when a 3 Gig file is opened:
#include <stdio.h>
#include <fstream>
main()
{
FILE *fp = fopen("largefile.sgy", "rb");
if(fp == NULL) perror("fopen");
}
The following works just fine on the same 3 Gig file:
#include <stdio.h>
main()
{
FILE *fp = fopen("largefile.sgy", "rb");
if(fp == NULL) perror("fopen");
}
The compile line is: g++ -D_FILE_OFFSET_BITS=64 -o junk junk.c
Wilf Kruggel