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. Qt Creator can not open terminal
Forum Updated to NodeBB v4.3 + New Features

Qt Creator can not open terminal

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
6 Posts 3 Posters 1.1k Views 1 Watching
  • 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.
  • T Offline
    T Offline
    thinkingfl
    wrote on 8 Aug 2023, 20:44 last edited by
    #1

    My Qt Creator can not open the terminal when I click the Run button. The application output shows: Starting XXXXXXX
    When I use the Run in terminal configuration, it can run in the terminal successfully.

    How to fix this problem?

    J 1 Reply Last reply 8 Aug 2023, 21:53
    0
    • T thinkingfl
      8 Aug 2023, 20:44

      My Qt Creator can not open the terminal when I click the Run button. The application output shows: Starting XXXXXXX
      When I use the Run in terminal configuration, it can run in the terminal successfully.

      How to fix this problem?

      J Offline
      J Offline
      JonB
      wrote on 8 Aug 2023, 21:53 last edited by JonB 8 Aug 2023, 21:53
      #2

      @thinkingfl
      What terminal are you expecting from where when you simply click the Run button? There isn't any, unless your application creates one or you run from a terminal in the first place.

      When you pick Run in terminal Qt Creator creates a terminal for you and runs your application in it.

      T 1 Reply Last reply 8 Aug 2023, 22:11
      1
      • J JonB
        8 Aug 2023, 21:53

        @thinkingfl
        What terminal are you expecting from where when you simply click the Run button? There isn't any, unless your application creates one or you run from a terminal in the first place.

        When you pick Run in terminal Qt Creator creates a terminal for you and runs your application in it.

        T Offline
        T Offline
        thinkingfl
        wrote on 8 Aug 2023, 22:11 last edited by
        #3

        @JonB My application (A console project) will create one terminal for sure. I can run it on VS code with the CMakeList and it can build, run and create the terminal output. But on QtCreate it can not open any terminal.

        A 1 Reply Last reply 8 Aug 2023, 23:02
        0
        • T thinkingfl
          8 Aug 2023, 22:11

          @JonB My application (A console project) will create one terminal for sure. I can run it on VS code with the CMakeList and it can build, run and create the terminal output. But on QtCreate it can not open any terminal.

          A Offline
          A Offline
          Axel Spoerl
          Moderators
          wrote on 8 Aug 2023, 23:02 last edited by
          #4

          @thinkingfl
          Please share the following information:

          • OS and Qt Creator Version
          • Is “run in terminal” selected?
          • The application itself brings up a terminal. What does that mean? Please show the relevant code.

          Please also check this link and share your local configuration.

          Software Engineer
          The Qt Company, Oslo

          T 1 Reply Last reply 9 Aug 2023, 18:32
          2
          • A Axel Spoerl
            8 Aug 2023, 23:02

            @thinkingfl
            Please share the following information:

            • OS and Qt Creator Version
            • Is “run in terminal” selected?
            • The application itself brings up a terminal. What does that mean? Please show the relevant code.

            Please also check this link and share your local configuration.

            T Offline
            T Offline
            thinkingfl
            wrote on 9 Aug 2023, 18:32 last edited by
            #5

            @Axel-Spoerl
            Qt Creator: 11.0.1 Community
            Qt: 5.9.9
            OS: Windows 64bit
            Run in terminal is not selected.
            Its a console application, theoretically it will open a terminal and wait for me to input something than stop the porject. (I just try a Hello world

            QT pro file
            QT = core

            CONFIG += c++17 cmdline

            You can make your code fail to compile if it uses deprecated APIs.

            In order to do so, uncomment the following line.

            #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0

            SOURCES +=
            main.cpp

            Default rules for deployment.

            qnx: target.path = /tmp/$${TARGET}/bin
            else: unix:!android: target.path = /opt/$${TARGET}/bin
            !isEmpty(target.path): INSTALLS += target

            Main cpp file
            #include <QCoreApplication>
            #include <iostream>

            int main(int argc, char *argv[])
            {
            QCoreApplication a(argc, argv);
            std::cout<<"Hello world!"<<std::endl;
            std::cout<<"Press Enter to exis"<<std::endl;
            std::cin.get();
            return 0;
            }

            Envrioment variables are corrected configured. If I selected run in terminal, the program run without any problem. But When I dis-selected it, the application output
            11:31:57: Starting C:\Users\zmh\Documents\build-test-Desktop_Qt_5_9_9_MinGW_32bit-Release\release\test.exe...
            Hello world!
            Press Enter to exis
            11:31:57: C:\Users\zmh\Documents\build-test-Desktop_Qt_5_9_9_MinGW_32bit-Release\release\test.exe exited with code 0

            And nothing show

            J 1 Reply Last reply 9 Aug 2023, 19:03
            0
            • T thinkingfl
              9 Aug 2023, 18:32

              @Axel-Spoerl
              Qt Creator: 11.0.1 Community
              Qt: 5.9.9
              OS: Windows 64bit
              Run in terminal is not selected.
              Its a console application, theoretically it will open a terminal and wait for me to input something than stop the porject. (I just try a Hello world

              QT pro file
              QT = core

              CONFIG += c++17 cmdline

              You can make your code fail to compile if it uses deprecated APIs.

              In order to do so, uncomment the following line.

              #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0

              SOURCES +=
              main.cpp

              Default rules for deployment.

              qnx: target.path = /tmp/$${TARGET}/bin
              else: unix:!android: target.path = /opt/$${TARGET}/bin
              !isEmpty(target.path): INSTALLS += target

              Main cpp file
              #include <QCoreApplication>
              #include <iostream>

              int main(int argc, char *argv[])
              {
              QCoreApplication a(argc, argv);
              std::cout<<"Hello world!"<<std::endl;
              std::cout<<"Press Enter to exis"<<std::endl;
              std::cin.get();
              return 0;
              }

              Envrioment variables are corrected configured. If I selected run in terminal, the program run without any problem. But When I dis-selected it, the application output
              11:31:57: Starting C:\Users\zmh\Documents\build-test-Desktop_Qt_5_9_9_MinGW_32bit-Release\release\test.exe...
              Hello world!
              Press Enter to exis
              11:31:57: C:\Users\zmh\Documents\build-test-Desktop_Qt_5_9_9_MinGW_32bit-Release\release\test.exe exited with code 0

              And nothing show

              J Offline
              J Offline
              JonB
              wrote on 9 Aug 2023, 19:03 last edited by
              #6

              @thinkingfl
              So your code itself does not create any console. Maybe I'm mistaken, but aren't you supposed to tick Run in terminal? Else what is the point of that? Without it std::cin won't be open hence it runs to completion.

              1 Reply Last reply
              2
              • Christian EhrlicherC Christian Ehrlicher moved this topic from General and Desktop on 10 Aug 2023, 03:33

              1/6

              8 Aug 2023, 20:44

              • 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