问题:error MSB6006: “cmd.exe”已退出,代码为 123。
解决办法:打开.vcxproj文件。发现原来编译不报错testTranslateQtUi.ui的配置如下:
<CustomBuild Include="testTranslateQtUi.ui"> <FileType>Document</FileType> <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> "$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)"</Command> <Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Uic%27ing %(Identity)...</Message> </CustomBuild> </ItemGroup>
但是,新建Qt5_matchingTemplate.ui,点击编译后,报错 :error MSB6006: “cmd.exe”已退出,代码为 123,
发现其位置为:
需要添加配置:
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> "$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)"</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Uic%27ing %(Identity)...</Message>
添加配置之后,点击保存,并且重新在VS中加载全部项目。
再次点击.ui文件,进行编译,成功生成.h文件(此时,生成的文件在子目录GeneratedFiles下,需要添加现有项目加载到VS中)