Nominate our 2022 Qt Champions!

Windows 8 form project - crash on start-up

  • Hi all,

    I'm designing a form using the form editor in the following installation;

    Qt Creator 3.2.1 (opensource)
    Based on Qt 5.3.2 (MSVC 2010, 32 bit)

    EDIT: The above shows on the 'About' window, but the installer I've used is qt-opensource-windows-x86-msvc2013-5.3.2.

    I'm using Microsoft Visual C++ Compiler 12.0.

    I've been able to start creating a form which will compile and run, but after a while of adding widgets and frames, the project starts to crash on start-up, with the following error message.

    "The inferior stopped because it triggered an exception.
    Stopped in thread 0 by: Exception at 0x66aa00a7, code: 0xc0000005: read access violation at: 0x0, flags=0x0 (first chance). "

    The code in the project is absolutely minimal, I'll paste it here:

    Main::Main(QWidget *parent): QMainWindow(parent)

    delete ui;

    int main(int argc, char** argv)
    QApplication a(argc, argv);

    Main main;;


    Does anyone have an idea of what could be causing the crash? The call-stack shows its not happening anywhere near my code:

    0 isRecursive qmutex.cpp 70 0x66aa00a7
    1 QBasicMutex::isRecursive qmutex.cpp 289 0x66a9f5b5
    2 QBasicMutex::lockInternal qmutex.cpp 424 0x66a9f5f1
    3 QBasicMutex::lockInternal qmutex.cpp 417 0x66a9f5d1
    4 QBasicMutex::lock qmutex.h 68 0x66a5436e
    5 QRecursiveMutexPrivate::lock qmutex.cpp 629 0x66aa0ed3
    6 QMutex::lock qmutex.cpp 224 0x66a9fbeb
    7 QMutexLocker::QMutexLocker qmutex.h 137 0x66a4cd28
    8 QLoggingRegistry::registerCategory qloggingregistry.cpp 312 0x66ccdcc4
    9 QLoggingCategory::QLoggingCategory qloggingcategory.cpp 205 0x66ccc4ce
    10 lcQpaBackingStore qwindowscontext.cpp 86 0xf37d7cc
    11 QWindowsBackingStore::QWindowsBackingStore qwindowsbackingstore.cpp 64 0xf4885a1
    12 QWindowsGdiIntegration::createPlatformBackingStore qwindowsgdiintegration.cpp 78 0xf48a4a8
    13 QBackingStore::QBackingStore qbackingstore.cpp 132 0xffbe3ba
    14 QWidgetPrivate::create_sys qwidget_qpa.cpp 164 0x64873dec
    15 QWidget::create qwidget.cpp 1312 0x6483d708
    16 QWidget::setVisible qwidget.cpp 7334 0x648376cb
    17 QWidget::show qwidget.cpp 7037 0x64837c1b
    18 main main.cpp 23 0x13c139
    19 WinMain qtmain_win.cpp 131 0x16525a
    ... <More>

    I thought form-editors allowed you to design GUIS without worrying about this kind of thing.

    Any answers would be greatly appreciated :-)

    [edit: added missing codings tags @ SGaist]

  • My first guess would be that you're using the wrong binaries - if you're using Qt 5.3.2 MSVC 2010, you should compile with Microsoft Visual C++ 2010. If you're using Visual C++ 12, do get Qt binaries for MSVC 2013.

    Basically, you need to use Qt compiled with the same compiler you're using, down to major version (at lest with MSVC), so go to "Qt's downloads section": and grab Qt compiled with MSVC 2013.

  • Hmm sorry for the misinformation, but the info I posted:

    Qt Creator 3.2.1 (opensource)
    Based on Qt 5.3.2 (MSVC 2010, 32 bit)

    was copied/pasted from the About QtCreator window - it seems to be incorrect! I am using the qt-opensource-windows-x86-msvc2013-5.3.2 installer.

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    No it's not, Qt Creator is build with MSVC2010 and that as nothing to do with the current version of Qt your are using. Qt Creator can handle several versions of Qt using different compilers without any problem.

    From the installer you downloaded. You have a Qt build with with MSVC2013.

Log in to reply