I have inside the output folder a folder called foo
with an executable a.exe
that I would like to call. Unfortunately it isn't opening and whatever is the directory I pass to setWorkingDirectory
, I get an error output.
The code:
QProcess proc;
proc.setWorkingDirectory("foo"); //tried full path, warap in quotes etc..
proc.setProgram("a.exe");
proc.start();
Checking error:
qDebug() << "error = " << proc.error();
It outputs:
0
value which is QProcess::FailedToStart
(see QProcess::ProcessError
)
I want the application to start from its working directory and not the caller executable's working directory because of the dependencies files.