c++ - Mingw32 at win7x64 :Qt 5. 3.0 x86编译: wrong path fed to uic. exe

标签 c++ qt makefile mingw qmake

我正在尝试编译我从 Qt git 中提取的当前“稳定”版本。问题是当它尝试使用 uic(UI 编译器)时,我的路径变量以某种方式被破坏并且它找不到路径上的 icu 库,但是如果我将库放在与 uic 相同的目录中它可以工作,但这并不是真正的解决方案。

我的路径变量:

%CommonProgramFiles%\Microsoft Shared\Windows Live;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;%systemroot%\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files (x86)\Windows Kits\8.0\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;%systemroot%\System32\WindowsPowerShell\v1.0\;I:\miktex\miktex\bin;E:\Program Files\doxygen\bin;E:\Python27;E:\icu\lib;E:\strawberry\c\bin;E:\strawberry\perl\site\bin;E:\strawberry\perl\bin;E:\Program Files (x86)\Git\bin;

mingw32-make 的相关输出是

mingw32-make[3]: Entering directory 'e:/qt5/qtbase/src/widgets'
mingw32-make -f Makefile.Debug all
mingw32-make[4]: Entering directory 'e:/qt5/qtbase/src/widgets'
PATH=e:/qt5/qtbase/lib${PATH:+:$PATH} e:/qt5/qtbase/bin/uic.exe dialogs/qfiledialog.ui -o .uic/ui_qfiledialog.h
Makefile.Debug:2443: recipe for target '.uic/ui_qfiledialog.h' failed
mingw32-make[4]: Leaving directory 'e:/qt5/qtbase/src/widgets'
Makefile:38: recipe for target 'debug-all' failed
mingw32-make[3]: Leaving directory 'e:/qt5/qtbase/src/widgets'
Makefile:437: recipe for target 'sub-widgets-make_first' failed
mingw32-make[2]: Leaving directory 'e:/qt5/qtbase/src'
Makefile:41: recipe for target 'sub-src-make_first' failed
mingw32-make[1]: Leaving directory 'e:/qt5/qtbase'
Makefile:64: recipe for target 'module-qtbase-make_first' failed

关于 PATH=e:/qt5/qtbase/lib${PATH:+:$PATH} 的部分在我看来非常可疑,遗憾的是我对 makefile 和这种特殊语法知之甚少。

最佳答案

我遇到了基本上相同的问题 - uic.exe 的调用会无声地失败,构建配方也会失败。原来 make 被我路径中的空格弄糊涂了。转到系统控制面板在系统路径的开头和结尾添加双引号(如果不存在)似乎可以解决问题。我的用户路径是空的(只有一对引号),但如果还没有的话,可能也需要在其周围添加引号。

早些时候我也解决了这个问题,方法是转到系统控制面板获取默认路径,去除带空格的条目,然后在 PowerShell 中运行以下命令:

PS C:\Qt\build\5.4.1> $env:Path="C:\Perl64\site\bin;C:\Perl64\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\mingw-w64\i686-4.9.2-posix-dwarf-rt_v4-rev2\mingw32\bin"
PS C:\Qt\build\5.4.1> mingw32-make -j

然后构建正常进行。顺便说一句,第一行只设置当前 PowerShell session 的路径,不会影响注册表中设置的路径。

关于c++ - Mingw32 at win7x64 :Qt 5. 3.0 x86编译: wrong path fed to uic. exe,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23287215/

相关文章:

shell - 使 : Capture output of shell command and return code at same time

linux - 找不到子文件夹中的 header

c++ - 元素序列的对齐

c++ - 错误 C2664 : 'App *const' to 'QWidget *'

c++ - 标签上的绑定(bind)循环警告

c++ - 使用 inputMask 时不显示 TextFields 中的 placeholderText

c - 制作 : Nothing to be done for `all'

c++ - Qt 中对 vtable 的 undefined reference

c++ - 将元素插入到 C++ 映射中 - 插入方法的差异

c++ - vector 中的所有推回值更改为默认值