Package: mingw32 Version: 3.4.2.20040916.1-2 Severity: normal Hi,
there is a problem with the binaries created by the cross-compiler; if they use the standard C++ library to access big files, seeking beyond 4GB does not appear to work. For a loong time, this was an upstream problem, but it was fixed with mingw.org's 3.4.0 release. Unfortunately, it still happens with binaries that I cross-compile from Debian. :-( The small program below prints the correct value "63" when compiled under Windows XP using mingw.org's binaries, but prints "-1 strerror: no error" (i.e. EOF) when cross-compiled. Working configurations on Windows were all the post-3.4.0 ones that I tried. Today, I specifically re-checked that the following results in working binaries: gcc-core-3.4.1-20040711-1.tar.gz gcc-g++-3.4.1-20040711-1.tar.gz w32api-2.5.tar.gz mingw-runtime-3.3.tar.gz gcc-core-3.4.2-20040916-1.tar.gz gcc-g++-3.4.2-20040916-1.tar.gz w32api-2.5.tar.gz (sorry, forgot upgrading that) mingw-runtime-3.7.tar.gz "g++ -v" prints this: Reading specs from C:/msys/1.0/mingw/bin/../lib/gcc/mingw32/3.4.2/specs Configured with: ../gcc/configure --with-gcc --with-gnu-ld --with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --enable-languages=c,c++,f77,ada,objc,java --disable-win32-registry --disable-shared --enable-sjlj-exceptions --enable-libgcj --disable-java-awt --without-x --enable-java-gc=boehm --disable-libgcj-debug --enable-interpreter --enable-hash-synchronization --enable-libstdcxx-debug Thread model: win32 gcc version 3.4.2 (mingw-special) A fix for this would be very much appreciated!! - Compiling on Windows with MSYS is such a PITA! :-/ ---------------------------------------------------------------------- #include <fstream> #include <iostream> #include <string.h> using namespace std; int main() { fstream f("testfile", ios::binary|ios::in|ios::out|ios::trunc); #ifdef __MINGW32__ unsigned long long left = 0x100001000ULL; char buf[4096]; memset(buf, 0, 4096); f.write(buf, 4096); f.write("[EMAIL PROTECTED]", 10); // 64 aka '@' at 0x1004 f.write(buf, 4096 - 10); left -= 8192; while (left > 0) { f.write(buf, 4096); left -= 4096; } #else f.seekp(0x100001000ULL); #endif f.write("YADA?YADA!", 10); f.seekg(0x100001004ULL); cout << f.get() << endl; // Should print 63 for the '?' at 0x100001004 cout << "strerror: " << strerror(errno) << endl; } ---------------------------------------------------------------------- -- System Information: Debian Release: 3.1 APT prefers testing APT policy: (990, 'testing') Architecture: i386 (i686) Kernel: Linux 2.4.27 Locale: LANG=C, LC_CTYPE=de_DE (charmap=ISO-8859-15) Versions of packages mingw32 depends on: ii libc6 2.3.2.ds1-20 GNU C Library: Shared libraries an ii mingw32-binutils 2.15.94-20050118.1-1 Minimalist GNU win32 (cross) binut ii mingw32-runtime 3.7-1 Minimalist GNU win32 (cross) runti -- no debconf information -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]