Important: Please read the Qt Code of Conduct -

Using Qt Creator 2.6.0 with Qt5

  • Hi
    I have downloaded Qt 5 and Qt Creator 2.6.0
    Used creator to make a GUI project (based on main window)
    Compiles ok
    When I run I get this error message
    Starting C:\QTProjects\TestGui-build-std-Debug\debug\TestGui.exe...
    The program has unexpectedly finished.
    C:\QTProjects\TestGui-build-std-Debug\debug\TestGui.exe exited with code -1073741701
    Can anyone tell me what is wrong?
    A QtConsole app compiles and runs successfully


  • Moderators

    You need to give us some more information, preferably relevant parts of the source code.

  • The source code is as simple as it gets
    The program is crashing before it hits main
    I think it is a dependancy problem

  • Moderators

    You are not helping, you know.

    Check out the .pro file, then: it should have:
    QT += core gui widgets

    in Qt5.

  • Ok, my apologies
    here is my .pro file

    Project created by QtCreator 2012-11-09T12:41:27


    QT += core gui widgets

    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

    TARGET = Test
    TEMPLATE = app

    SOURCES += main.cpp

    HEADERS += mainwindow.h

    FORMS += mainwindow.ui

    and here is my main.cpp
    #include "mainwindow.h"
    #include <QApplication>

    int main(int argc, char *argv[])
    QApplication a(argc, argv);
    MainWindow w;;

    return a.exec&#40;&#41;;

    All generated from within the creator IDE

    But it still wont run!

    Thanks for your time

  • Moderators

    Looks fine. Make a clean and rebuild, take a look at "Compile Output" tab in QtCreator. Maybe ut has some hints.

  • Hi
    This is the build log - cant see anything obvious
    13:02:55: Running steps for project Test3...
    13:02:55: Starting: "C:\Qt\qt5\qtbase\bin\qmake.exe" C:\QTProjects\Test3\ -r -spec win32-g++ "CONFIG+=qml_debug"
    13:02:56: The process "C:\Qt\qt5\qtbase\bin\qmake.exe" exited normally.
    13:02:56: Starting: "C:\mingw\bin\mingw32-make.exe"
    C:/mingw/bin/mingw32-make -f Makefile.Debug
    mingw32-make[1]: Entering directory 'C:/QTProjects/Test3-build-std-Debug'
    C:\Qt\qt5\qtbase\bin\uic.exe ..\Test3\mainwindow.ui -o ui_mainwindow.h
    g++ -c -pipe -fno-keep-inline-dllexport -g -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_QML_DEBUG -DQT_DLL -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_OPENGL_ES_2 -DQT_OPENGL_ES_2_ANGLE -DQT_NEEDS_QMAIN -I..\Test3 -I"....\Qt\qt5\qtbase\include" -I"....\Qt\qt5\qtbase\include\QtWidgets" -I"....\Qt\qt5\qtbase\include\QtGui" -I"....\Qt\qt5\qtbase\include\QtCore" -I"debug" -I"." -I"." -I"....\Qt\qt5\qtbase\mkspecs\win32-g++" -o debug\main.o ..\Test3\main.cpp
    g++ -c -pipe -fno-keep-inline-dllexport -g -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_QML_DEBUG -DQT_DLL -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_OPENGL_ES_2 -DQT_OPENGL_ES_2_ANGLE -DQT_NEEDS_QMAIN -I..\Test3 -I"....\Qt\qt5\qtbase\include" -I"....\Qt\qt5\qtbase\include\QtWidgets" -I"....\Qt\qt5\qtbase\include\QtGui" -I"....\Qt\qt5\qtbase\include\QtCore" -I"debug" -I"." -I"." -I"....\Qt\qt5\qtbase\mkspecs\win32-g++" -o debug\mainwindow.o ..\Test3\mainwindow.cpp
    C:\Qt\qt5\qtbase\bin\moc.exe -DUNICODE -DQT_QML_DEBUG -DQT_DLL -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_OPENGL_ES_2 -DQT_OPENGL_ES_2_ANGLE -DQT_NEEDS_QMAIN -I..\Test3 -I"....\Qt\qt5\qtbase\include" -I"....\Qt\qt5\qtbase\include\QtWidgets" -I"....\Qt\qt5\qtbase\include\QtGui" -I"....\Qt\qt5\qtbase\include\QtCore" -I"debug" -I"." -I"." -I"....\Qt\qt5\qtbase\mkspecs\win32-g++" -D__GNUC__ -DWIN32 ..\Test3\mainwindow.h -o debug\moc_mainwindow.cpp
    g++ -c -pipe -fno-keep-inline-dllexport -g -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_QML_DEBUG -DQT_DLL -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_OPENGL_ES_2 -DQT_OPENGL_ES_2_ANGLE -DQT_NEEDS_QMAIN -I..\Test3 -I"....\Qt\qt5\qtbase\include" -I"....\Qt\qt5\qtbase\include\QtWidgets" -I"....\Qt\qt5\qtbase\include\QtGui" -I"....\Qt\qt5\qtbase\include\QtCore" -I"debug" -I"." -I"." -I"....\Qt\qt5\qtbase\mkspecs\win32-g++" -o debug\moc_mainwindow.o debug\moc_mainwindow.cpp
    g++ -Wl,-subsystem,windows -mthreads -o debug\Test3.exe debug/main.o debug/mainwindow.o debug/moc_mainwindow.o -lmingw32 -lqtmaind -LC:/Qt/qt5/qtbase/lib -lQtWidgetsd5 -LC:/Qt/qt5/qtbase/lib -lQtGuid5 -LC:/Qt/qt5/qtbase/lib -lQtCored5 -llibEGL -llibGLESv2 -lgdi32 -luser32
    mingw32-make[1]: Leaving directory 'C:/QTProjects/Test3-build-std-Debug'
    13:03:01: The process "C:\mingw\bin\mingw32-make.exe" exited normally.

  • Moderators

    I experienced mysterious crashes with Qt 4.8, when I used a compiler version that was incompatible with my Qt libraries.

    What version of GCC are you using? Is it 32-bit or 64-bit?

    How did you obtain your Qt 5 binaries?

  • I bet you have some based Qt program installed in your Windows, that deployed some old Qt dlls to your windows sistem32 directory. Probably you didnt set your windows path with qt5 dll directory wich is causing your .exe file to link agains wrong dlls. Copy your exe file to a new directory, togheter with all the needed dlls of Qt5: qtcore.dll , qtgui.dll, ... (I cant remember the exact dll names, I not on windows right now), I bet it will work.
    If that work, and if you have qt dll in your system32 probably you will have to replaced them with qt5 dlls. This is the famous dllhell.

  • I think this problem inherited from qt 4.8.3, where the compiler build for 64 bit windows 7 machine.

    I tried for my portedcanvas.exe and found that 3 dll (IEShims.dll, sysntfy.dll, gpsvc.dll are for 64 bit os machine).

    my problem solved by download MinGW 4.4 from Nokia website. []


Log in to reply