Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved Terminal Program won't run from the prompt

    General and Desktop
    2
    6
    849
    Loading More Posts
    • 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
      Papa last edited by

      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 Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        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 Reply Quote 1
        • P
          Papa last edited by

          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 Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            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 Reply Quote 0
            • P
              Papa last edited by

              Topic Tools button? I cannot find it!

              1 Reply Last reply Reply Quote 0
              • SGaist
                SGaist Lifetime Qt Champion last edited by

                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 Reply Quote 0
                • First post
                  Last post