×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Nov 2010
    Posts
    1

    QT 4.7.1 Win 7 x64 VS 2010: Debug works, Release crashes

    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 and compiled with x64 VS console.
    Compilation worked, so that I recieved a debug and release dll.

    My test program is very simple:

    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)
    {
    
    	QApplication app( argc, argv ) ;
    	
    	QTreeWidget* wg = new QTreeWidget() ;
    	
    	wg->show() ;
    
    	//QWidget* wg2 = new QWidget() ;
    	//wg2->show() ;
    
    	return app.exec();
    }
    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
    Code:
    QTreeWidget* wg = new QTreeWidget() ;
    wg->show() ;
    to
    Code:
    QTreeWidget* wg = new QTreeWidget() ;
    //wg->show() ;
    the release mode compiled app suddenly works.

    If I do this
    Code:
    QTreeWidget* wg = new QTreeWidget() ;
    //wg->show() ;
    
    QWidget* wg2 = new QWidget() ;
    wg2->show() ;
    Everything works.
    If I do this again:
    Code:
    QTreeWidget* wg = new QTreeWidget() ;
    wg->show() ;
    
    QWidget* wg2 = new QWidget() ;
    wg2->show() ;
    The application crashes again.

    If I so this:
    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!
    #endif
    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!
    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:
    Unhandled exception at 0x5cb96e5f in QtReleaseBuildTest.exe: 0xC0000005: Access violation reading location 0x0000000000000000.
    Call stack is:
    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()
    Has somebody any idea?

    Thanks
    Last edited by voodoo1234; 2010-11-26 at 03:23.

  2. #2
    Registered User
    Join Date
    Jul 2005
    Posts
    2

    Re: QT 4.7.1 Win 7 x64 VS 2010: Debug works, Release crashes

    I am trouble with this problem long time, the Qt example tree widget crashes too. On release mode under win7 x64 bits, the problem can reproduce.

Similar Threads

  1. Replies: 0
    Last Post: 2010-10-29, 09:04
  2. Win an N8 - Qt article contest on Wiki - November, 2010
    By kiran10182 in forum News, Announcements and Job Listings
    Replies: 0
    Last Post: 2010-10-29, 09:03
  3. Replies: 1
    Last Post: 2010-06-13, 17:37
  4. Problems installing PC Suite / x64 Win 7 on VMWare
    By seagrams in forum General Development Questions
    Replies: 2
    Last Post: 2010-05-25, 14:25
  5. Want a new PC suite for Win XP x64 pro
    By sudeep_mib in forum PC Suite API and PC Connectivity SDK
    Replies: 0
    Last Post: 2005-11-07, 16:17

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •