Qt Forum

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

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    QProcess execute a unkown program

    General and Desktop
    qprocess red pitaya compilation
    3
    5
    2871
    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.
    • G
      grafzahl last edited by

      Hi,

      i want to execute with QProcess a program (arm-linux-gnueabi-gcc), which Qt doesn't know. I need that for cross-compiling code for a Red Pitaya.

      Terminal:

      • molsyst@molsyst:~$ arm-linux-gnueabi-gcc
      • arm-linux-gnueabi-gcc: fatal error: no input files
      • compilation terminated.
        (program is recognised)

      Qt:

      • QProcess *compile1;
      • compile1 = new QProcess(this);
      • compile1->start("arm-linux-gnueabi-gcc");
      • qDebug() << compile1->errorString();
        Output:
      • Select all"No such file or directory"

      But why does Qt not know a program, which the terminal knows?

      I already asked this question in the RedPitaya Forum ( http://forum.redpitaya.com/viewtopic.php?f=14&t=465&p=1764 ), but i think here it is better placed.

      Thanks in advance
      GrafZahl

      1 Reply Last reply Reply Quote 0
      • M
        mcosta last edited by

        Hi,

        You have to provide the full path

        Once your problem is solved don't forget to:

        • Mark the thread as SOLVED using the Topic Tool menu
        • Vote up the answer(s) that helped you to solve the issue

        You can embed images using (http://imgur.com/) or (http://postimage.org/)

        1 Reply Last reply Reply Quote 0
        • V
          Vince Golubic last edited by

          Precisely. Here's a good example that can help.

          http://doc.qt.io/qt-5/qdir.html

          One other thing that can help, as a plan B.

          You can execute a normal Linux process under Qt using the system (" ") call from within Qt -with arguments included in " ", or try:

          Example:
          {
          const char* sys_command;

          sys_command.toLatin1().constData() ;
          system(sys_command);
          }

          1 Reply Last reply Reply Quote 0
          • G
            grafzahl last edited by

            Thanks for answers.

            Full path was the solution, now it works fine. 8-)
            I also now use the system command.

            Thanks

            M 1 Reply Last reply Reply Quote 0
            • M
              mcosta @grafzahl last edited by

              @grafzahl said:

              I also now use the system command.

              If you can, I suggest to use QProcess to run external commands. This for two reasons:

              1. QProcess is cross-platform (in the future you could want to build your application also on other platforms);
              2. You can have direct access to the standard out/err, ....

              Once your problem is solved don't forget to:

              • Mark the thread as SOLVED using the Topic Tool menu
              • Vote up the answer(s) that helped you to solve the issue

              You can embed images using (http://imgur.com/) or (http://postimage.org/)

              1 Reply Last reply Reply Quote 0
              • First post
                Last post