Important: Please read the Qt Code of Conduct -

QProcess execute a unkown program

  • 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.


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


    • QProcess *compile1;
    • compile1 = new QProcess(this);
    • compile1->start("arm-linux-gnueabi-gcc");
    • qDebug() << compile1->errorString();
    • 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 ( ), but i think here it is better placed.

    Thanks in advance

  • Hi,

    You have to provide the full path

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

    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:

    const char* sys_command;

    sys_command.toLatin1().constData() ;

  • Thanks for answers.

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


  • @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, ....