如何在 Qt Creator (Mac OS X) 中添加 Qt SDK
我需要使用静态版本的 Qt SDK 编译我的 Qt 项目。
因此,我使用以下步骤从源代码编译了一个新的 SDK:
configure (+some options) make sudo make -j1 install
我认为所有这些步骤都是成功的,我可以在 /usr/local/Trolltech 中看到该 SDK。然后,如参考所示,我将这两行添加到我的.profile 文件:
PATH=/usr/local/Trolltech/Qt-4.7.1/bin:$PATH export PATH
但是,当我启动 Qt Creator 时,它没有使用这个新的 SDK,而是仍然使用最初安装的 SDK。我如何更改它并使其使用我的新 SDK?
I need to compile my Qt project using a static version of the Qt SDK.
So I have compiled from source a new SDK using these steps:
configure (+some options) make sudo make -j1 install
I think all these steps were successful and I can see the SDK in /usr/local/Trolltech. Then, as indicated on the reference, I have added these lines two my .profile file:
PATH=/usr/local/Trolltech/Qt-4.7.1/bin:$PATH export PATH
However, when I start Qt Creator, it is not using this new SDK but still using the one that was installed initially. How can I change that and make it use my new SDK?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

发布评论
评论(2)
为了允许 Creator 在 PATH 中找到 Qt 安装,您需要为 GUI 应用程序设置 PATH 变量。以下是有关如何在 OS X 中设置它的一些讨论:
https:// serverfault.com/questions/16355/how-to-set-global-path-on-os-x
查找对“environment.plist
”的修改。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
在 QtCreator 的首选项中,有“Qt4”项(左侧),您可以在其中手动指定 Qt 的路径。
关于 PATH 变量的更改,只有从终端启动 QtCreator 时才会考虑它们。
In QtCreator's preferences, there's "Qt4" item (on the left) where you can specify path to your Qt manually.
Regarding PATH variable changes, they'll only be taken into account if you start QtCreator from Terminal.