Important: Please read the Qt Code of Conduct -

Terminal Program won't run from the prompt

  • 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 ("es") == 0 ||"ES") == 0)  {
            if ("fr") == 0 ||"FR") == 0) {
            if ("?") == 0) {
            std::wcout << L"ascii all" << std::endl
                << L"ascii es" << std::endl
                << L"ascii fr" << std::endl;
            if ("all") == 0){
                std::wcout << "Need to enter dic";
    void DisplayEs() {
    void DisplayFr() {

    Did I do something wrong?

  • Lifetime Qt Champion


    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

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

  • Lifetime Qt Champion

    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 :)

  • Topic Tools button? I cannot find it!

  • Lifetime Qt Champion

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

Log in to reply