Reputation:
I have Qt Creator 4.4.1 installed on Windows 10 64 bit. I have also bash on ubuntu on windows
installed. I want to call bash
from Qt creator in order to execute some linux commands on the project directory by creating a custom building process step but unfortunately I get the following error:
16:21:50: Running steps for project myTest...
16:21:50: Could not start process "bash" foamExec
Error while building/deploying project myTest (kit: Desktop Qt 5.9.3 MinGW 32bit)
When executing step "Custom Process Step"
16:21:50: Elapsed time: 00:00.
I have also tried the following steps:
bash
: C:\Windows\System32\bash.exe
but it fails with the
same error.
cmd
to execute a .bat script that contains the
following code: bash -c "my command that I want to execute"
but I get the following error as well:
``16:30:31: Running steps for project myTest...
16:30:31: Starting: "C:\WINDOWS\system32\cmd.exe" /c "bash -c 'foamExec wmake'"
'bash' is not recognized as an internal or external command,
operable program or batch file.
16:30:31: The process "C:\WINDOWS\system32\cmd.exe" exited with code 1.
Error while building/deploying project myTest (kit: Desktop Qt 5.9.3 MinGW 32bit)
When executing step "Custom Process Step"``.
"/mnt/c/Qt/Qt5.9.3/Tools/QtCreator/bin/qtcreator.exe"
Qt Creator starts fine but again it doesn't recognize bash
command.bash
?
Upvotes: 0
Views: 2307
Reputation: 81
This is not a complete answer, but maybe someone will figure out the rest.
The "bash not recognized" part is because of this issue - basically, Qt is a 32-bit application, while bash.exe is a 64-bit application, and since Qt's cmd is 32-bit, it cannot find it.
However, addressing this introduces a different error. I've tried the following:
Neither of the above work, instead failing with "The process exited with code -1". This happens even with a 64-bit version of QtCreator - it seems that there's something about WSL that prevents it from running inside QtCreator.
Upvotes: 0