Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. QtCreator's Debugger not working with CLI apps
QtWS25 Last Chance

QtCreator's Debugger not working with CLI apps

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
6 Posts 3 Posters 421 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Pete Carter
    wrote on 12 Sept 2023, 14:57 last edited by Pete Carter 9 Dec 2023, 14:59
    #1

    I created a simple C++ CLI app (Non-Qt Project > Plain C++ Application) in QtCreator.

    main.cpp

    #include <iostream>
    
    int main()
    {
        std::cout << "Hello, world!\n\n";
        return 0;
    }
    

    hello_world.pro

    TEMPLATE = app
    CONFIG += console c++17
    CONFIG -= app_bundle
    CONFIG -= qt
    
    SOURCES += \
            main.cpp
    

    Now when running this app, the output is as expected:

    Screenshot_20230912_172356.png

    That "qtc-process_stub" error is mentioned here and i think it has nothing to do with this topic.

    Notice that i am using the external terminal, the app is running in the external terminal. Everything works fine.


    Now when i try debugging the app, no output is shown in the terminal from the debugger:

    Terminal window:

    Screenshot_20230912_172542.png

    IDE's window:

    Screenshot_20230912_172602.png

    Even when i try setting breakpoints, the debugger is showing no output ?!

    The debuggers are configured correctly in the settings, both GDB and LLDB.

    It's also worth mentioning that the debugger works fine in Qt projects.

    M 1 Reply Last reply 13 Sept 2023, 07:34
    0
    • P Pete Carter
      12 Sept 2023, 14:57

      I created a simple C++ CLI app (Non-Qt Project > Plain C++ Application) in QtCreator.

      main.cpp

      #include <iostream>
      
      int main()
      {
          std::cout << "Hello, world!\n\n";
          return 0;
      }
      

      hello_world.pro

      TEMPLATE = app
      CONFIG += console c++17
      CONFIG -= app_bundle
      CONFIG -= qt
      
      SOURCES += \
              main.cpp
      

      Now when running this app, the output is as expected:

      Screenshot_20230912_172356.png

      That "qtc-process_stub" error is mentioned here and i think it has nothing to do with this topic.

      Notice that i am using the external terminal, the app is running in the external terminal. Everything works fine.


      Now when i try debugging the app, no output is shown in the terminal from the debugger:

      Terminal window:

      Screenshot_20230912_172542.png

      IDE's window:

      Screenshot_20230912_172602.png

      Even when i try setting breakpoints, the debugger is showing no output ?!

      The debuggers are configured correctly in the settings, both GDB and LLDB.

      It's also worth mentioning that the debugger works fine in Qt projects.

      M Offline
      M Offline
      Marcus Tillmanns
      wrote on 13 Sept 2023, 07:34 last edited by
      #2

      @Pete-Carter Would you mind opening a bugreport on bugreports.qt.io and describe your build environment a little more? What compilers, debugger, qt version, Qt Creator version etc.

      Thanks!

      P 1 Reply Last reply 13 Sept 2023, 08:03
      2
      • M Marcus Tillmanns
        13 Sept 2023, 07:34

        @Pete-Carter Would you mind opening a bugreport on bugreports.qt.io and describe your build environment a little more? What compilers, debugger, qt version, Qt Creator version etc.

        Thanks!

        P Offline
        P Offline
        Pete Carter
        wrote on 13 Sept 2023, 08:03 last edited by
        #3

        @Marcus-Tillmanns

        Created a bug here: https://bugreports.qt.io/browse/QTCREATORBUG-29608?filter=-2

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SimonSchroeder
          wrote on 13 Sept 2023, 08:35 last edited by
          #4

          I believe Qt Creator reroutes the output when debugging. Doesn't seem to make much sense when running a CLI application. At least on Windows there needs to be special treatment for GUI applications because they don't have a console output by default.

          The output might show in the Global Debugger Log (menu View -> Views -> Global Debugger Log). However, it will be intermingled with a lot of other things. (I am not sure if it is the Global Debugger Log view or another view. But there is a special view somewhere.)

          P 1 Reply Last reply 13 Sept 2023, 08:59
          0
          • S SimonSchroeder
            13 Sept 2023, 08:35

            I believe Qt Creator reroutes the output when debugging. Doesn't seem to make much sense when running a CLI application. At least on Windows there needs to be special treatment for GUI applications because they don't have a console output by default.

            The output might show in the Global Debugger Log (menu View -> Views -> Global Debugger Log). However, it will be intermingled with a lot of other things. (I am not sure if it is the Global Debugger Log view or another view. But there is a special view somewhere.)

            P Offline
            P Offline
            Pete Carter
            wrote on 13 Sept 2023, 08:59 last edited by
            #5

            @SimonSchroeder

            Issue fixed in QtCreator 11.0.3

            Downloaded it from here: https://download.qt.io/snapshots/qtcreator/11.0/11.0.3/43/

            M 1 Reply Last reply 13 Sept 2023, 09:02
            2
            • P Pete Carter
              13 Sept 2023, 08:59

              @SimonSchroeder

              Issue fixed in QtCreator 11.0.3

              Downloaded it from here: https://download.qt.io/snapshots/qtcreator/11.0/11.0.3/43/

              M Offline
              M Offline
              Marcus Tillmanns
              wrote on 13 Sept 2023, 09:02 last edited by
              #6
              This post is deleted!
              1 Reply Last reply
              0
              • aha_1980A aha_1980 has marked this topic as solved on 24 Dec 2023, 05:12

              1/6

              12 Sept 2023, 14:57

              • Login

              • Login or register to search.
              1 out of 6
              • First post
                1/6
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved