我在Windows 10 64位上安装了Qt Creator 4.4.1。我还安装了bash on ubuntu on windows
。我想从Qt创建者调用bash
,以便通过创建自定义构建过程步骤在项目目录上执行一些linux命令,但不幸的是我收到以下错误:
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.
我也尝试了以下步骤:
bash
:C:\Windows\System32\bash.exe
的完整路径但是它失败了
同样的错误。
cmd
执行包含。的脚本.bat脚本
以下代码:bash -c "my command that I want to execute"
但我也收到以下错误:
``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启动正常,但它又不识别bash
命令。bash
吗?
答案 0 :(得分:0)
这不是一个完整的答案,但也许有人会弄明白其余的。
“bash not recognized”部分是因为this issue - 基本上,Qt是一个32位应用程序,而bash.exe是一个64位应用程序,而且由于Qt的cmd是32位,它找不到它。
但是,解决这个问题会引入不同的错误。我尝试了以下内容:
以上工作都没有,而是“使用代码-1退出进程”失败。即使使用64位版本的QtCreator,也会发生这种情况 - 似乎有一些关于WSL的东西阻止它在QtCreator中运行。