Qt版本无效 [英] Qt version is invalid
问题描述
我正在Linux上工作,并且已经从源代码安装了Qt Creator 2.5.2,Qt库4.7.4和4.4.3.由于版本之间不兼容,我无法直接安装二进制文件.Qt 4.7.4和Qt 4.4.3的安装过程相同.我面临的问题是Qt Creator可以识别Qt 4.7.4而不是Qt 4.4.3,并且有错误
I am working on Linux and I have installed Qt Creator 2.5.2, Qt libraries 4.7.4 and 4.4.3 all from sources. I cannot install the binaries directly for incompatibility between versions. The installation processes for both Qt 4.7.4 and Qt 4.4.3 were the same. The issue I am facing is that Qt Creator recognizes Qt 4.7.4 but not Qt 4.4.3, with the error
Qt版本无效:无法确定到的路径Qt安装的二进制文件,也许路径是错误的.
The Qt version is invalid : Could not determine the path to the binaries of the Qt installation, maybe the path is wrong.
每个库都安装在/home/$ username/qt/Qt- $ version
中.当我使用
Well each library is installed in /home/$username/qt/Qt-$version
. When I manually compile a project with
cd directory
/home/$username/qt/Qt-4.4.3/qmake $PATHPRO
make
一切正常,我可以运行该应用程序.
Everything work as a charm and I can run the app.
我尝试了什么?
- 重新编译Qt-4.4.3
- 检查文件夹权限
- 重新启动Qt Creator
- 在桌面上砸我的头
有什么想法吗?操作系统为SUSE Enterprise 11-32位.
Any thoughts? The OS is SUSE Enterprise 11-32bits.
推荐答案
问题已解决:D.
QtCreator通过使用一些 qmake属性
查找库.它通过执行命令 qmake -query
来查询这些属性.问题在于,当这些变量存在于Qt 4.7.4库中时,这些变量都没有在Qt 4.4.3库中设置.
QtCreator find libraries by using some qmake properties
. It query for these properties by executing the command qmake -query
. The issue was that none of these variables were set in the Qt 4.4.3 library while they were present in the Qt 4.7.4 library.
所以解决方案是使用
home/$username/qt/Qt-4.4.3/bin/qmake -set VARIABLE VALUE
其中value通常是目录的路径
where value is usually a path to a directory
4.7.4中的变量:
Variables in 4.7.4:
QT_INSTALL_PREFIX: home/$username/qt/Qt-4.7.4/
QT_INSTALL_DATA:
QT_INSTALL_DOCS:
QT_INSTALL_HEADERS:
QT_INSTALL_LIBS:
QT_INSTALL_BINS:
QT_INSTALL_PLUGINS:
QT_INSTALL_IMPORTS:
QT_INSTALL_TRANSLATIONS:
QT_INSTALL_CONFIGURATION:
QT_INSTALL_EXAMPLES:
QT_INSTALL_DEMOS:
QMAKE_MKSPECS:
QMAKE_VERSION:2.01a
QT_VERSION:4.7.4
我认为最重要的是QT_INSTALL_LIBS
、QT_INSTALL_LIBS
和QT_VERSION
.请参见配置qmake环境.
I think the most important are QT_INSTALL_LIBS
, QT_INSTALL_LIBS
and QT_VERSION
.
see configuring qmake environment.
这篇关于Qt版本无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!