简体   繁体   English

qt 4.8.3中的Qt资源系统错误

[英]Qt resource system bug in qt 4.8.3

I'm using Qt 4.8.3 Open Source with Qt Creator 2.6.0 on Windows 8 Pro x64.我在 Windows 8 Pro x64 上使用 Qt 4.8.3 Open Source 和 Qt Creator 2.6.0。 The compiler I'm using is MingW 4.4.我使用的编译器是 MingW 4.4。

I've an old project that I built using Qt 4.8.0.我有一个使用 Qt 4.8.0 构建的旧项目。 The project has a resource file named Resource.qrc .该项目有一个名为Resource.qrc的资源文件。 The project compiled fine in Qt 4.8.0 and I could access everything that I mentioned in the resource file.该项目在 Qt 4.8.0 中编译得很好,我可以访问我在资源文件中提到的所有内容。

But in Qt 4.8.3 I can't compile the same project.但是在 Qt 4.8.3 中我无法编译同一个项目。 Qt 4.8.3 doesn't seem to be able to compile resource file. Qt 4.8.3 似乎无法编译资源文件。 Here is the part of the output that tried to compile Resource.qrc file:这是试图编译Resource.qrc文件的输出部分:

bin\rcc.exe -name Resource ..\Source\Resource.qrc -o release\qrc_Resource.cpp
mingw32-make[1]: Leaving directory `E:/Programs/Version Control/Sources/Spadetrump/Release'
process_begin: CreateProcess(NULL, bin\rcc.exe -name Resource ..\Source\Resource.qrc -o release\qrc_Resource.cpp, ...) failed.
make (e=2): The system cannot find the file specified.
mingw32-make[1]: *** [release/qrc_Resource.cpp] Error 2
mingw32-make: *** [release] Error 2
00:08:10: The process "C:\MingW\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project Spadetrump (target: Desktop)
When executing step 'Make'

It was a clean build.这是一个干净的构建。 If I execute rcc.exe with the exact same arguments and with absolute path, qrc_Resource.cpp is generated.如果我使用完全相同的参数和绝对路径执行rcc.exeqrc_Resource.cpp生成qrc_Resource.cpp

I tried the above with a fresh new Qt GUI application and the result is same.我用一个全新的 Qt GUI 应用程序尝试了上述操作,结果是一样的。

Any idea what's wrong with Qt 4.8.3?知道 Qt 4.8.3 有什么问题吗?

Had the exact same issues as you with the same setup, expect for the windows version which is xp for me.使用相同的设置遇到与您完全相同的问题,期待对我来说是 xp 的 Windows 版本。 The problem is that the rcc.exe cannot be found, because an incorrect path is used for that call.问题是无法找到 rcc.exe,因为该调用使用了不正确的路径。

There is a bugreport at qt-projects for this problem: https://bugreports.qt.io/browse/QTBUG-27237在 qt-projects 有一个关于这个问题的错误报告: https : //bugreports.qt.io/browse/QTBUG-27237

The workarround proposed by Daniel Frömmel did the trick for me: Daniel Frömmel 提出的解决方法对我有用:

1) open the qmake.conf of your platform (for me its C:\\Qt\\4.8.3\\mkspecs\\win32-g++) 1)打开你平台的qmake.conf(对我来说是C:\\Qt\\4.8.3\\mkspecs\\win32-g++)
2) search for QMAKE_IDC 2)搜索QMAKE_IDC
3) add the following line after the QMAKE_IDC line: QMAKE_RCC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}rcc.exe 3) 在 QMAKE_IDC 行之后添加以下行: QMAKE_RCC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}rcc.exe
4) save file and clsoe 4)保存文件和clsoe
5) restart all your dev tools and remove all auto generated Makefiles 5) 重新启动所有开发工具并删除所有自动生成的 Makefile
6) recompile 6)重新编译

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM