Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Terminal Program won't run from the prompt
Qt 6.11 is out! See what's new in the release blog

Terminal Program won't run from the prompt

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 2 Posters 1.7k Views 2 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.
  • P Offline
    P Offline
    Papa
    wrote on last edited by
    #1

    My terminal program compiles and runs from Qt Creator, but when I try to run it from PowerShell, it quietly do not run.

    #pragma warning(default: 4290)
    #include <QCoreApplication>
    
    
    #include "abc.hpp"
    #include "ascii/ascii.hpp"
    
    using namespace std;
    void DisplayEs();
    void DisplayFr();
    int main(int argc, char *argv[])
    {
        QCoreApplication a(argc, argv);
    
        if (argc > 1) {
            // convert argv[1] to a std::string
            QString str = argv[1];
            if ( str.compare("es") == 0 || str.compare("ES") == 0)  {
                DisplayEs();
                abc::ascii_es();
            }
            if (str.compare("fr") == 0 || str.compare("FR") == 0) {
                DisplayFr();
    
            }
            if (str.compare("?") == 0) {
            std::wcout << L"ascii all" << std::endl
                << L"ascii es" << std::endl
                << L"ascii fr" << std::endl;
            }
            if (str.compare("all") == 0){
                abc::ascii_all();
            }
            else{
                std::wcout << "Need to enter dic";
            }
    
        }
    }
    void DisplayEs() {
    ...
    }
    void DisplayFr() {
    ...
    }
    
    

    Did I do something wrong?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Since you are executing it out of Qt Creator, you have to use the same steps as for a deployment. You can use windeployqt to get your executable dependencies in the same folder so you can run it properly.

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • P Offline
        P Offline
        Papa
        wrote on last edited by
        #3

        The key to deployment is windeployqt. I found a video in Spanish Here and Qt also has a mute version here.
        Thanks SGaist!

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          You're welcome !

          Since you have it working now, please mark the thread as solved using the "Topic Tool" button so other forum users may know a solution has been found :)

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • P Offline
            P Offline
            Papa
            wrote on last edited by
            #5

            Topic Tools button? I cannot find it!

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              There's one under the original post and one at the bottom of the page.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0

              • Login

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