[Qt-interest] MinGW and msvcr90.dll under Windows

Bob Babcock wssddc at nospam.gis.net
Fri Nov 26 23:33:36 CET 2010


I need to use (under Windows XP) _fseeki64 and _ftelli64 to
handle files larger than 2GB.  If I build with VC++ 2008 Express,
my code works without doing anything special.

With MinGW, it's more complicated and goes horribly wrong.  In
stdio.h, the needed functions are only defined if
__MSVCRT_VERSION__ >= 0x800.  I define it everywhere as 0x900 and
get an unable to load msvcr90.dll error at runtime.  This is one
of Microsoft's side-by-side DLLs, which means I need a manifest.
So, I extract a specs file from gcc and make an additional specs
file for msvcr90, following instructions at
http://www.mingw.org/wiki/SpecsFileHOWTO.  Manifest files I
borrow from the VC++ build.

Now the problems: my debug build with MinGW needs to have both
msvcr90.dll and msvcr90d.dll in the manifest.  This seems wrong,
and I saw a comment somewhere indicating that problems arise if
memory is allocated in a debug dll and freed in non-debug.  Sure
enough, I get "Invalid Address specified to RtlFreeHeap" as I
single-step over a clearContents call for a tableWidget.  A non-debug
build gets the same error, so it isn't just mixing DLLs.  I see this
in a simple test program that does nothing more than
  ui->tableWidget->setItem(0, 0, new QTableWidgetItem("foo"));
  ui->tableWidget->clearContents();
Code using _fseeki64 and _ftelli64 is never executed in these tests.
Qt is version 4.71.

Am I doing the right things to get _fseeki64 into my code?
Have I hit a bug, and if so, is it in Qt, MinGW or Windows?
Any suggestions?



More information about the Qt-interest-old mailing list