Stackoverflow question
I want to run a command in Ubuntu via Qt using QProcess. My command is fluent3DMeshToFoam <mesh address> and when I run it into terminal its OK and produces sum output and files in a specific location. But I have problem with running it using QProcess.
I have noticed that I should add the path of fluent3DMeshToFoam to ProcessEnvironment of my QProcess object. So I did:
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
env.insert("PATH" , env.value("PATH") + ":"+"<path of fluent3DMeshToFoam>");
myProcess.setProcessEnvironment(env);
myProcess.
start("fluent3DMeshToFoam" ,
QStringList() <<
"<mesh address>");
myProcess.waitForFinished(-1);
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
env.insert("PATH" , env.value("PATH") + ":"+"<path of fluent3DMeshToFoam>");
myProcess.setProcessEnvironment(env);
myProcess.start("fluent3DMeshToFoam" , QStringList() << "<mesh address>");
myProcess.waitForFinished(-1);
To copy to clipboard, switch view to plain text mode
I connected readyRead()and errorOccurred() signals and after I run, the errorOccurred signal emits and the following error shows:
execve: No such file or directory
I searched alot and could not find out where the problem is. thanks.
Bookmarks