如何在MacOS X Sierra上安装Qt并在终端上添加qmake
How to install Qt on MacOS X Sierra and add qmake on terminal
我想在我的Mac上安装Qt,并使用qmake通过终端编译代码。我从Qt网站下载了开源Qt Creator,但我无法设置它。有人有类似的问题吗?
系统:Mac OS X Sierra,Qt版本:5.7。我正在从qt.io/download-开源下载开源安装程序。我正在安装它到用户/MyUserAccount,我想设置它,所以我可以编译c++代码与qmake &&使
只是提供另一种使用Homebrew的解决方案。
因为你已经发现QT4不兼容Mac OSX Sierra。
你可以安装QT5使用:
brew install qt5
但是你会发现你不能从命令行访问qmake。要纠正这个错误,您需要运行:
brew link qt5 --force
如果要从命令行运行qmake
,需要在PATH
环境变量中添加qmake
所在目录。如何做到这一点取决于您正在使用的shell,对于bash,可以通过将export PATH=$PATH:<path_to_qmake>
添加到~/.profile
, ~/.bash_profile
或~/.bashrc
来完成。
安装QT4:-https://github.com/cartr/homebrew-qt4
brew tap cartr/qt4
brew tap-pin cartr/qt4
brew install qt@4
安装QT5:-
brew install qt5
相关文章:
- 将成员变量添加到共享库中的类中,不会破坏二进制兼容性吗
- 如何在C++中从两个单独的for循环中添加两个数组
- 如何在linux终端中同时编译和运行c++代码
- POCO::PostgreSQL:如何将std::vector支持添加到`Binder::bind`
- 如何仅为一个函数添加延迟
- 如何防止 c++ 在从浮点型转换为双精度型(不适用于 IO)时添加额外的小数?
- 使用std::transform将一个范围的元素添加到另一个范围中
- 如何将更多文件夹添加到c++include路径
- 如何将元素添加到数组的线程安全函数?
- QT通过C++添加映射QML项目
- 如何将点击的信号和插槽添加到qt中的自定义按钮中
- 终端不会为C++文件创建.exe文件吗
- 如何使用重载的相等(==)运算符向测试用例添加描述
- 为什么Mat类的两个对象可以在不重载运算符+的情况下添加
- 如何防止clang格式在流运算符调用之间添加换行符<<
- 只能向C++添加一定数量的字符
- 添加 g++ 的 -std= 标志时,C++打印到终端的速度要慢得多?
- 我在我的程序中添加了一个void函数,它不接受任何参数,现在我的程序在运行时只返回一个空白终端
- 如何在MacOS X Sierra上安装Qt并在终端上添加qmake
- 我应该如何将固定进度条添加到生成终端输出的C++程序中(在 Linux 中)