QMAKE:QMAKESPEC 尚未设置
我最近重新编译了 Qt,以便可以使用静态库而不是共享库。但现在,当我尝试编译我的项目时,出现以下错误:
QMAKESPEC尚未设置,因此无法推断配置。
这似乎是一个常见问题,我在发布之前做了一些研究。让我困惑的是我确实设置了 QMAKESPEC 环境变量。这是 printenv QMAKESPEC 的输出
/usr/local/Trolltech/Qt-4.4.0/mkspecs/linux-g++
另外,这里是 qmake -query QMAKESPEC 的输出
linux-g++
我也尝试过使用这些值,但似乎 qmake 根本看不到该变量... QTDIR 也被正确指定。
我也尝试过重新编译Qt并重新安装它。
感谢您的帮助。
I have recently recompiled Qt so that I can use static instead of shared libraries. But now, when I try to compile my project, I get the following error:
QMAKESPEC has not been set, so configuration cannot be deduced.
It seems like a common problem and I did do some research before posting. What's puzzling me is that I did set the QMAKESPEC env var. Here is the output of printenv QMAKESPEC
/usr/local/Trolltech/Qt-4.4.0/mkspecs/linux-g++
Also, here is the output of qmake -query QMAKESPEC
linux-g++
I have also tried playing around with the values, but it seems that qmake can't see that variable at all... QTDIR is also specified properly.
I have also tried to recompile Qt and reinstall it.
Thanks for your help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
只需在运行 qmake 之前将其添加到脚本中即可
。 qmake 现在已安装。
Just add this to a script before running qmake
qmake is now installed.
如果你懒得做额外的 set-env 事情,这里做的是单行:
其他平台也是如此
if you are lazy to do extra set-env stuff, do here is a one liner:
same goes for other platforms
我遇到了同样的问题并通过安装 libqt4-dev 包解决了它。
I had the same problem and solved it by installing the libqt4-dev package.
从 4.8 开始,qmake 拥有一个持久信息系统,可以使用
-set
选项定义该系统,并使用-query
进行查询。有关更多详细信息,请参阅配置 qmake 的环境 qmake 4.8 和 qmake 5.0 的配置 qmake。
From 4.8 on, qmake has a system of persistent information that can be defined using the
-set
option, and consulted using-query
.For more detail, consult the Configuring qmake's Environment for qmake 4.8, and Configuring qmake for qmake 5.0.
好吧,抱歉,我想我知道问题出在哪里。我一直在从 /usr/bin/ 中留下的旧 Qt 安装中获取 qmake。我现在已经删除了它,并打算重新尝试安装 Qt。希望它会起作用=)
Ok, sorry, I think I know what's the problem. I have been picking up qmake from the old Qt installation that was left in /usr/bin/. I have deleted it now, and going to re-try installing Qt. Hope it will work =)