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. QProcess : "Process failed to start : No such file or directory"
Forum Updated to NodeBB v4.3 + New Features

QProcess : "Process failed to start : No such file or directory"

Scheduled Pinned Locked Moved Solved General and Desktop
14 Posts 2 Posters 7.8k Views 1 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.
  • J Offline
    J Offline
    Julie
    wrote on last edited by Julie
    #1

    Hello everyone,

    I develop an application with Qt Creator 4.3.1 (based on Qt 5.9.1) (MVC 2015, 32 bit). I'm on windows 10 x64 and my application is in C++.

    This is part of my main function :

    void fenetreprincipale::on_boutton_ValiderParametres_clicked(){
            argumentsROI = ajoutDesArguments();
    
            if(ui->matrice->isChecked()){
                    argumentsROI.append("--return_matrix");
            }
            else if(ui->check_seuil->isChecked()){
                    argumentsROI.append("--threshold="+seuil);
            }
    
            if(lancementDuProgrammeROI()){
                    /*To DO*/
            }
    ]
    

    now this is a function i use :

    QStringList fenetreprincipale::ajoutDesArguments(){
        arguments.clear();
        arguments.append("--file="+nomDuFichierSelectionne);
        arguments.append("--dset="+nomDuJeuDeDonne);
        arguments.append("--CCD_variance="+variance);
        arguments.append("--CCD_gain="+gain);
    
        return arguments;
    }
    
    bool fenetreprincipale::lancementDuProgrammeROI(){
        processusOK = true;
        processusROI.setProgram(nomDuProgrammeROI);
        processusROI.setArguments(argumentsROI);
        processusROI.start();
    
        if(!processusROI.waitForStarted()){
            processusOK = false;
            QMessageBox::warning(this, "Erreur", "Le processus roi n'a pas démarré.\n"+processusROI.errorString());
        }
        else{
            if(!processusROI.waitForFinished()){
                processusOK = false;
                QMessageBox::warning(this, "Erreur", "Le processus roi ne c'est pas terminé.\n"+processusROI.errorString());
            }
        }
        return processusOK;
    }
    

    here is my class fenetrePrincipale.h :

    #ifndef FENETREPRINCIPALE_H
    #define FENETREPRINCIPALE_H
    
    #include <QMainWindow>
    #include <QFileDialog>
    #include <QMessageBox>
    #include <QDir>
    #include <QProcess>
    
    namespace Ui {
        class fenetreprincipale;
    }
    
    class fenetreprincipale : public QMainWindow{
        Q_OBJECT
    
    public:
        explicit fenetreprincipale(QWidget *parent = 0);
        ~fenetreprincipale();
    
    private slots:
        void on_boutton_ParcourirFichier_clicked();
        void on_boutton_ValiderParametres_clicked();
    
    private:
        Ui::fenetreprincipale *ui;
    
        /*--on_boutton_ValiderParametres_clicked()--*/
        QStringList argumentsROI;
        QStringList ajoutDesArguments();
        bool lancementDuProgrammeROI();
    
        /*--creationDUnDossierContenantLesResultat()--*/
        QString nomDuFichier_clone;
        QString nomDuDossierDesResultats;
        QDir dossierDesResultats;
    
        /*--recuperationDesArguments()--*/
        QString nomDuJeuDeDonne;
        QString variance;
        QString seuil;
        QString gain;
    
        /*--ajoutDesArguments()--*/
        QStringList arguments;
    
        /*--lancementDuProgrammeROI()--*/
        bool processusOK;
        QProcess processusROI;
        QString nomDuProgrammeROI = "roi.exe";
    };
    
    #endif // FENETREPRINCIPALE_H
    
    

    I don't understand my error.
    Furthermore there are tree week it works.
    the only element changed is a deleted directory (with program roi.exe i use).
    I download it again on github. But i'm sure i add *.dll on it and i don't remember there name.

    Please help me.

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

      Hi,

      Where is roi.exe located on your system ?

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

      J 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Where is roi.exe located on your system ?

        J Offline
        J Offline
        Julie
        wrote on last edited by Julie
        #3

        @SGaist hi,

        roi.exe is in the directory of my program.

        Thanks for reply :)

        mon dossier

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

          Then I'd use the full path to it in your application rather than relying on that. The working directory may not be the same as the one your program is stored in.

          You can use QApplication::applicationDirPath for that.

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

          J 1 Reply Last reply
          2
          • SGaistS SGaist

            Then I'd use the full path to it in your application rather than relying on that. The working directory may not be the same as the one your program is stored in.

            You can use QApplication::applicationDirPath for that.

            J Offline
            J Offline
            Julie
            wrote on last edited by
            #5

            @SGaist Thank you It seems to be that !
            I continue and i tell you if it's always ok.

            1 Reply Last reply
            1
            • J Offline
              J Offline
              Julie
              wrote on last edited by Julie
              #6

              I add my next verification :

              if(lancementDuProgrammeROI()){
                   if(processusROI.exitCode() == 0){
                        /*TO DO*/
                   }
                    else if(processusROI.error() != 0){
                         QMessageBox::warning(this, "Erreur", "Le programme roi a planté.\n"+statutDeLApplication.number(processusROI.exitStatus())+" : "+processusROI.errorString());
                   }
               }
              

              I obtain this :
              erreur_2

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

                What kind of application is roi.exe ?

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

                J 1 Reply Last reply
                1
                • SGaistS SGaist

                  What kind of application is roi.exe ?

                  J Offline
                  J Offline
                  Julie
                  wrote on last edited by
                  #8

                  @SGaist

                  it's an application in C use library gsl, hdf5, (fits at the end).
                  I compile it (and it works with cygwin)

                  If you realy want to see the project i use is here :
                  https://github.com/christophe-pouzat/ENP2017

                  the compilation line on cygwin an terminal linux :

                  gcc -W -g -o code/roi code/roi.c -lgsl -lgslcblas -lhdf5 -lhdf5_hl -lm -std=gnu11
                  

                  and the execution is :

                  ./code/roi -f Data_POMC.hdf5 -d stack -g 0.14 -v 290 -m > out/rss_stat 
                  

                  I think it's a problem of dll missing in this directory but i don't find them.

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

                    You can use Dependency Walker to check what roi.exe needs to run

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

                    J 1 Reply Last reply
                    1
                    • SGaistS SGaist

                      You can use Dependency Walker to check what roi.exe needs to run

                      J Offline
                      J Offline
                      Julie
                      wrote on last edited by Julie
                      #10

                      @SGaist I have already used it but after download 45 *.dll "API...." (and i don't find all in https://fr.dll-files.com/) I'm desesperate.

                      I see they are some *dll in 32bits and other in 64bits it's that ?
                      How i resolved it ?

                      Thanks again for your time :)

                      dependency walker

                      1 Reply Last reply
                      0
                      • J Offline
                        J Offline
                        Julie
                        wrote on last edited by
                        #11

                        new view :
                        dependency walker

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

                          The only files of real interest are the CYG**.dll the others are systems dll that you shouldn't need to do anything special for.

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

                          J 2 Replies Last reply
                          0
                          • SGaistS SGaist

                            The only files of real interest are the CYG**.dll the others are systems dll that you shouldn't need to do anything special for.

                            J Offline
                            J Offline
                            Julie
                            wrote on last edited by
                            #13

                            @SGaist ok, thanks!
                            And use this dll in c:cygwin64.
                            Why is'nt good ?
                            (I put new pictur in my last post)

                            I try to make same reserche with my c++ project and i see this (it's only a part of result):

                            dependency Walker

                            my project is in x86.
                            Do i change all my dll in x86 ?

                            1 Reply Last reply
                            0
                            • SGaistS SGaist

                              The only files of real interest are the CYG**.dll the others are systems dll that you shouldn't need to do anything special for.

                              J Offline
                              J Offline
                              Julie
                              wrote on last edited by
                              #14

                              thanks @SGaist I resolved my problem <3

                              In case of i loos it again or an other developper whant it i add :

                              • cygblas-0.dll
                              • cyggcc_s-1.dll
                              • cyggcc_s-seh-1.dll
                              • cyggfortran-3.dll
                              • cyggsl-19.dll
                              • cyghdf5_hl-10.dll
                              • cyghdf5-10.dll
                              • cygquadmath-0.dll
                              • cygwin1.dll
                              • cygz.dll
                              1 Reply Last reply
                              2

                              • Login

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