Hi.
The system is:
QT 4.7.1, Win 7 x64, VS 2010 Prof
I downloaded Qt 4.7.1(everywhere) from Nokia Ftp. Unzipped it and compiled it with x64 VS console.
Compilation worked, so that I recieved a debug and release dll.
My test program is very simple:
Qt Code:
#ifdef _DEBUG #pragma comment( lib, "QtMaind.lib" ) #pragma comment( lib, "QtGuid4.lib" ) #pragma comment( lib, "QtCored4.lib" ) #else #pragma comment( lib, "QtMain.lib" ) #pragma comment( lib, "QtCore4.lib" ) #pragma comment( lib, "QtGui4.lib" ) #endif int main(int argc, char** argv) { wg->show() ; //QWidget* wg2 = new QWidget() ; //wg2->show() ; return app.exec(); }To copy to clipboard, switch view to plain text mode
If I compile in debug mode, everything workds just fine.
BUT if I compile in release mode, the application crashes at app.exec().
The call stack shows the crash in QtGui4.dll.
If I change the line
toQt Code:
wg->show() ;To copy to clipboard, switch view to plain text mode
the release mode compiled app suddenly works.Qt Code:
//wg->show() ; // comment the show() hereTo copy to clipboard, switch view to plain text mode
If I do this
the code also works just fine.Qt Code:
//wg->show() ; wg2->show() ;To copy to clipboard, switch view to plain text mode
If I do this again:
The application crashes again.Qt Code:
wg->show() ; wg2->show() ;To copy to clipboard, switch view to plain text mode
If I change from release to debug lib for QtGui.lib,
everything works again. So there must be some kind of bug in the release build or I simply compiled my x64 qt wrong and the bug must be connected with QTreeWidget!Qt Code:
#ifdef _DEBUG #pragma comment( lib, "QtMaind.lib" ) #pragma comment( lib, "QtGuid4.lib" ) #pragma comment( lib, "QtCored4.lib" ) #else // else use RELEASE #pragma comment( lib, "QtMain.lib" ) #pragma comment( lib, "QtCore4.lib" ) #pragma comment( lib, "QtGuid4.lib" ) // HERE changed to debug lib! But here the release section resides! #endifTo copy to clipboard, switch view to plain text mode
Because if I simply show the QWidget, the app runs, with QTreeWidget it doesn't run, it crashes as described.
The run-time error is:
Call stack is:Unhandled exception at 0x5cb96e5f in QtReleaseBuildTest.exe: 0xC0000005: Access violation reading location 0x0000000000000000.
Has somebody any idea?QtGui4.dll!000000005cb96e5f()
[Frames below may be incorrect and/or missing, no symbols loaded for QtGui4.dll]
QtGui4.dll!000000005cb96eee()
QtGui4.dll!000000005cbcfe77()
QtGui4.dll!000000005cbd2b37()
QtGui4.dll!000000005c7aa886()
QtGui4.dll!000000005caaef87()
QtGui4.dll!000000005cb98ed5()
QtCore4.dll!000000005d1a2c43()
QtGui4.dll!000000005c760382()
QtGui4.dll!000000005c7632e6()
QtCore4.dll!000000005d1a2ad2()
QtGui4.dll!000000005c7a8bcd()
QtGui4.dll!000000005c79ecaf()
QtGui4.dll!000000005c79eba2()
QtGui4.dll!000000005c7a8d5c()
QtGui4.dll!000000005c915f36()
QtGui4.dll!000000005c79dd68()
QtGui4.dll!000000005c7aac75()
QtGui4.dll!000000005caaef87()
QtGui4.dll!000000005cb20782()
QtGui4.dll!000000005c760396()
QtGui4.dll!000000005c7632e6()
QtCore4.dll!000000005d1a2ad2()
QtCore4.dll!000000005d1a44ea()
QtCore4.dll!000000005d1c5e0e()
user32.dll!00000000778cc3c1()
user32.dll!00000000778cc60a()
QtCore4.dll!000000005d1c7c7a()
QtGui4.dll!000000005c7c3dc5()
QtCore4.dll!000000005d1a202a()
QtCore4.dll!000000005d1a61c0()
> QtReleaseBuildTest.exe!main(int argc, char * * argv) Line 34 + 0x6 bytes C++
QtReleaseBuildTest.exe!__tmainCRTStartup() Line 555 + 0x19 bytes C
kernel32.dll!00000000777af56d()
ntdll.dll!00000000779e3021()
Thanks
Bookmarks