Qmake 未指定有效的 qt
安装Qt后按照相应步骤在 Mac OS 上进行开源 C++ 开发的 SDK
二进制包注意事项:如果你有二进制包,只需 双击 Qt.mpkg 并按照说明安装 Qt。
是的,这就是我在 MacOsX 上安装 Qt 所做的全部工作。一切都很顺利,直到我运行一个示例应用程序,其中编译输出导致:
No valid Qt version set.
Set one in Preferences
Error while building project qtilk
When executing build step 'QMake'
Canceled build.
然后我尝试更改首选项中相应的 Qt 版本,并将鼠标悬停在路径上,我意识到我的 mkspec 未设置:
然后我尝试通过qmake -query
查询qmake:
QT_INSTALL_PREFIX:/
QT_INSTALL_DATA:/usr/local/Qt4.6
QT_INSTALL_DOCS:/Developer/Documentation/Qt
QT_INSTALL_HEADERS:/usr/include
QT_INSTALL_LIBS:/Library/Frameworks
QT_INSTALL_BINS:/Developer/Tools/Qt
QT_INSTALL_PLUGINS:/Developer/Applications/Qt/plugins
QT_INSTALL_TRANSLATIONS:/Developer/Applications/Qt/translations
QT_INSTALL_CONFIGURATION:/Library/Preferences/Qt
QT_INSTALL_EXAMPLES:/Developer/Examples/Qt/
QT_INSTALL_DEMOS:/Developer/Examples/Qt/Demos
**QMAKE_MKSPECS:/usr/local/Qt4.6/mkspecs**
QMAKE_VERSION:2.01a
QT_VERSION:4.6.2
QMAKE_MKSPECS似乎在这里设置?
设置我的 mkspec 可以解决我的构建问题吗?我尝试通过输入 export mkspec=macx-g++
进行设置。不过,mkspec 似乎没有设置任何内容。我洗耳恭听地等待着您的答复。提前致谢。
After installing Qt SDK for Open Source C++ development on Mac OS by following the respective steps
Note for the binary package: If you have the binary package, simply
double-click on the Qt.mpkg and follow the instructions to install Qt.
Yes, that is all I have done to install Qt on MacOsX. Everything was going fine, until I run a sample application, of which compile output resulted in:
No valid Qt version set.
Set one in Preferences
Error while building project qtilk
When executing build step 'QMake'
Canceled build.
Then I tried to change the respective Qt version in Preferences and I hovered over the Path, I realized my mkspec isn't set:
Then I tried querying qmake by qmake -query
:
QT_INSTALL_PREFIX:/
QT_INSTALL_DATA:/usr/local/Qt4.6
QT_INSTALL_DOCS:/Developer/Documentation/Qt
QT_INSTALL_HEADERS:/usr/include
QT_INSTALL_LIBS:/Library/Frameworks
QT_INSTALL_BINS:/Developer/Tools/Qt
QT_INSTALL_PLUGINS:/Developer/Applications/Qt/plugins
QT_INSTALL_TRANSLATIONS:/Developer/Applications/Qt/translations
QT_INSTALL_CONFIGURATION:/Library/Preferences/Qt
QT_INSTALL_EXAMPLES:/Developer/Examples/Qt/
QT_INSTALL_DEMOS:/Developer/Examples/Qt/Demos
**QMAKE_MKSPECS:/usr/local/Qt4.6/mkspecs**
QMAKE_VERSION:2.01a
QT_VERSION:4.6.2
QMAKE_MKSPECS seems to be set here??
Will setting my mkspec solve my building problem? I tried setting by typing export mkspec=macx-g++
. Still, mkspec seems not to be set to anything. I am all ears waiting for your answers. Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要设置正确的规格,请使用:
qmake -spec max-g++
To set the correct spec, use:
qmake -spec max-g++