Qt World Summit: Submit your Presentation

Qt 5.5 not working in Debug mode

  • Hi,

    I have just moved from Qt 5.2 to Qt 5.5 on a Windows 7 Pro 64bits machine using MinGw 4.9.2 and have a strange problem: My programs do not execute on debug mode, but do in release mode. To test that, I wrote this simple console app:

    int main(int argc, char *argv[])
        QCoreApplication a(argc, argv);
        return a.exec();
    When I set the debug mode and press the Run button, I get on the console window "press <RETURN> to close this window". But if I set the release mode I get "Test", as it should be. If I set the debug mode and press the "start debugging" button, I get an error message "cannot continue debugging process: The program is not being run".
    Any help is welcome.

  • Did you use the distributed Qt binaries or build your own? Your program works as expected in both debug and release builds on my system with the distributed binaries.

  • @Paul-H.
    Thanks for you answer. I used distributed binaries, specifically 'qt-unified-windows-x86-2.0.2-1-online.exe'. I shall probably try to reinstall?

  • You can certainly give that a try. If you clean the project and rebuild (in debug), what kind of messages are you getting in Compile Output or Issues?

  • I tried. I uninstall, clean registry and reinstall Qt, with the same result. Then I added the Qt 5.2.1 module to the installation, and debug works if the project is configured with this version, but not with 5.5.0 or 5.4.2 version. I don't know if the information is relevant or not, but the 5.5.0 and the 5.4.2 versions compile with MinGW 4.9 whereas the 5.2.1 compliles with MinGW 4.8.

    With Qt 5.5.0 in debug mode:
    **The console window displays **
    Press <RETURN> to close this window...
    the compile window displays:
    14:22:25: Running steps for project test...
    14:22:25: Configuration unchanged, skipping qmake step.
    14:22:25: Starting: "C:\Qt\Tools\mingw492_32\bin\mingw32-make.exe"
    C:/Qt/Tools/mingw492_32/bin/mingw32-make -f Makefile.Debug
    mingw32-make[1]: Entering directory 'D:/Users/Files/JCG/Programmation/Projets Qt/build-test-Desktop_Qt_5_5_0_MinGW_32bit-Debug'
    mingw32-make[1]: Nothing to be done for 'first'.
    mingw32-make[1]: Leaving directory 'D:/Users/Files/JCG/Programmation/Projets Qt/build-test-Desktop_Qt_5_5_0_MinGW_32bit-Debug'
    14:22:26: The process "C:\Qt\Tools\mingw492_32\bin\mingw32-make.exe" exited normally.
    14:22:26: Elapsed time: 00:01.
    and the Application output window displays:
    Starting D:\Users\Files\JCG\Programmation\Projets Qt\build-test-Desktop_Qt_5_5_0_MinGW_32bit-Debug\debug\test.exe...
    D:\Users\Files\JCG\Programmation\Projets Qt\build-test-Desktop_Qt_5_5_0_MinGW_32bit-Debug\debug\test.exe exited with code -1073741511

  • I don't think it is the compiler, since it works on my system with 4.9.2. However, the compile output you posted was not run after "Clean". You should see the g++ compile and link commands. For instance, here are the compiler commands when I build it:

    • g++ -c -pipe -fno-keep-inline-dllexport -g -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_CORE_LIB -I..\forumTest -I. -I..\..\..\Qt\5.5\mingw492_32_opengl_icu_ssl\include -I..\..\..\Qt\5.5\mingw492_32_opengl_icu_ssl\include\QtCore -Idebug -I..\..\..\Qt\5.5\mingw492_32_opengl_icu_ssl\mkspecs\win32-g++ -o debug\main.o ..\forumTest\main.cpp

    • g++ -Wl,-subsystem,console -mthreads -o debug\forumTest.exe debug/main.o -LG:/Qt/5.5/mingw492_32_opengl_icu_ssl/lib -lQt5Cored

    You may want to run qmake after cleaning, as well.

  • This post is deleted!

  • I think I finally understood the problem. Wthi the previous version of Qt (5.2), in order to run my programs outside QtCreator, I copied dlls like "Qt5Core*" from Qt/5.2/mingwxx_32/bin to windows/system (apparently, the installatiion of Qt doesn't do so). When I installed the version 5.5, these dlls present in windows/system apparently "screened" the dlls in Qt/5.5/mingwxx_32/bin, which correspond to Qt 5.2 and not to Qt5.5. I suppressed the dlls in windows/system, and the debug mode is now working.

  • I'm glad you got it working. For the future, I wouldn't recommend copying the dlls to the windows system directory. Check out this page for deploying on windows. In particular check out The Windows Deployment Tool section.