Debug Build Not Running



  • I have installed fresh QT5.5 using offline installer qt-opensource-windows-x86-mingw492-5.5.1.exe.
    I made a simple C++ project as follows:
    ...
    #include <iostream>

    using namespace std;

    int main()
    {
    cout << "Hello World!" << endl;
    return 0;
    }
    ...

    After building the program I am not able to run it in debug mode. But the program runns perfectly fine in release mode.
    I am not able to understand the problem with this debug mode running.

    Any sort of help is appreciated.


    I am totally new and naive in QT development.
    I have 64bit Windows7 system.
    I have added "C:\Qt\Qt5.5.1\5.5\mingw492_32\bin" in PATH env variable.
    As the program runs properly in release mode thus I don't think there should be any dll linking problem else it also wont run properly.


  • Moderators

    Hi, welcome to devnet.

    What does it mean "I am not able to run it"? Does it not start or a debugger is not attached? Is there any error message or information in build window? How are you running it? What do you click etc.? Provide as many details as you can think of, otherwise it's just wild guessing for us.

    I have added "C:\Qt\Qt5.5.1\5.5\mingw492_32\bin" in PATH env variable.

    Don' t do that! Remove it and don't ever put Qt or compilers in PATH variable.



  • @Chris-Kawa said:

    I have added "C:\Qt\Qt5.5.1\5.5\mingw492_32\bin" in PATH env variable.

    Don' t do that! Remove it and don't ever put Qt or compilers in PATH variable.

    What is the reason for that?



  • @Chris-Kawa

    There are icons on the left bottom corner for build(hammer) and run(play icon). I am running the debug mode program by clicking on Play icon.
    But the program loads in the memory and is stucking somewhere, not able to figure it out where. And I have removed the path dir for env variable.
    Thanks for that update.

    Compiling Output for building

    22:54:19: Running steps for project demoCPP...
    22:54:19: Configuration unchanged, skipping qmake step.
    22:54:19: Starting: "C:\Qt\Qt5.5.1\Tools\mingw492_32\bin\mingw32-make.exe"
    C:/Qt/Qt5.5.1/Tools/mingw492_32/bin/mingw32-make -f Makefile.Debug
    mingw32-make[1]: Entering directory 'E:/cppProjects/QT/demoCPP'
    g++ -c -pipe -fno-keep-inline-dllexport -g -std=c++0x -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -I. -IC:\Qt\Qt5.5.1\5.5\mingw492_32\mkspecs\win32-g++ -o debug\main.o main.cpp
    g++ -Wl,-subsystem,console -mthreads -o debug\demoCPP.exe debug/main.o
    mingw32-make[1]: Leaving directory 'E:/cppProjects/QT/demoCPP'
    22:54:21: The process "C:\Qt\Qt5.5.1\Tools\mingw492_32\bin\mingw32-make.exe" exited normally.
    22:54:21: Elapsed time: 00:02.

    Compiling output for running in debug mode

    23:00:41: Running steps for project demoCPP...
    23:00:41: Configuration unchanged, skipping qmake step.
    23:00:41: Starting: "C:\Qt\Qt5.5.1\Tools\mingw492_32\bin\mingw32-make.exe"
    C:/Qt/Qt5.5.1/Tools/mingw492_32/bin/mingw32-make -f Makefile.Debug
    mingw32-make[1]: Entering directory 'E:/cppProjects/QT/demoCPP'
    mingw32-make[1]: Nothing to be done for 'first'.
    mingw32-make[1]: Leaving directory 'E:/cppProjects/QT/demoCPP'
    23:00:42: The process "C:\Qt\Qt5.5.1\Tools\mingw492_32\bin\mingw32-make.exe" exited normally.
    23:00:42: Elapsed time: 00:01.

    Application Output Window

    Starting E:\cppProjects\QT\demoCPP\debug\demoCPP.exe...
    ....
    Other than this there are no fail or warning messages.
    And qtcreator_process_stub.exe command prompt window opens and remains in open state till I do force exit via Ctr+C.



  • Hi, just a guess! but I have seen this problem when Shadow build (on the Projects page) is checked for Release build and unchecked for Debug builds. See if both your checkboxes are either both unchecked or both checked.

    Edit: seems you have Shadow build currently unchecked for Debug builds, maybe try to select it...



  • Sorry to say that I tried to do this also i.e. enabling/disabling Shadow build for debug and/or release builds but still not working....!!!



  • I also have tried to reinstall QT many times but the problem still occurs.
    It will be very nice for some suggestions regarding fresh installation process.



  • One more update....
    After applying a very small change to above C++ code, release build also shows same behavior as debug build i.e. release build also doesn't run.

    #include <iostream>
    using namespace std;
    int main()
    {
    int x;
    x=100;
    x++;
    // cout << "Hello World!" << endl;
    cout << x<< "....!!!";
    return 0;
    }


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.