我需要为我的一个类安装qt4 C++框架。我尝试为qt4.7和qt4.8使用下载存档页面中的常规安装程序,但是我得到了警告:
"Installing this package may damage your system, and the installation may fail."因此,我研究了通过自制安装它,并初步尝试:
brew tap cartr/qt4
brew tap-pin cartr/qt4
brew install qt@4但是,这给了我一个错误:
Error: Calling brew tap-pin user/tap is disabled! Use fully-scoped user/tap/formula naming instead.我在线查找解决方案,并能够通过省略brew tap-pin cartr/qt4命令来安装它:
brew tap cartr/qt4
brew install qt@4然后,我尝试在python中创建一个示例qt程序,并检查了我使用的版本,它说我正在使用CLion (来自python发行版)。所以我的问题是,我能同时在我的系统上安装qt4和qt5吗?如何选择要使用的版本?
发布于 2020-07-23 02:23:31
你可以同时安装。您可以选择使用哪一个。
当您使用qt (意为qt5)安装homebrew时,它会产生一条“警告”消息来回答您的问题。
qt (意为qt5)才是可用的。qt始终可用,那么您只需将这些设置放在点文件中。F 211
如果安装qt@4并将这些变量设置为指向qt@4,则qt@4将可用。
您可以使用brew info qt再次查看相同的“警告”消息。以下是整个信息:
qt is keg-only, which means it was not symlinked into /usr/local,
because Qt 5 has CMake issues when linked.
If you need to have qt first in your PATH run:
echo 'export PATH="/usr/local/opt/qt/bin:$PATH"' >> ~/.zshrc
For compilers to find qt you may need to set:
export LDFLAGS="-L/usr/local/opt/qt/lib"
export CPPFLAGS="-I/usr/local/opt/qt/include"
For pkg-config to find qt you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/qt/lib/pkgconfig"与qt@4相同的命令为我提供了qt@4:
export PATH="/usr/local/opt/qt@4/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/qt@4/lib"
export CPPFLAGS="-I/usr/local/opt/qt@4/include"
export PKG_CONFIG_PATH="/usr/local/opt/qt@4/lib/pkgconfig"顺便说一句,我使用user/抽头/公式语法安装了qt@4:brew install cartr/qt4/qt@4
https://stackoverflow.com/questions/60142981
复制相似问题