c++ - CGAL 安装 MacOS QT5
问题描述
我正在尝试从开发人员网站cgal
构建其中一个演示。
我已经cgal
使用brew install cgal
. 我还使用安装了qt5
5.15.2 版brew install qt5
但是,当我尝试构建演示时(我正在查看示例中给出的相同演示$HOME/CGAL-5.2.1/examples/Triangulation_
),我收到一个很长的错误make
,我不知道如何解释。
我的电脑运行的是 OS X 11.0.1。Clang 是版本 12.0.0
/opt/homebrew/include/QtCore/qglobal.h:667:65: error: expected '>'
typename = std::enable_if_t<std::is_arithmetic_v<T> && std::is_arithmetic_v<U> &&
^
/opt/homebrew/include/QtCore/qglobal.h:667:65: error: expected ',' or '>' in template-parameter-list
/opt/homebrew/include/QtCore/qglobal.h:668:66: error: expected unqualified-id
std::is_floating_point_v<T> == std::is_floating_point_v<U> &&
^
/opt/homebrew/include/QtCore/qglobal.h:679:35: error: no type named 'Promoted' in namespace
'QTypeTraits::detail'
using Promoted = typename detail::Promoted<T, U>::type;
~~~~~~~~~~~~~~~~~^~~~~~~~
/opt/homebrew/include/QtCore/qglobal.h:679:43: error: expected ';' after alias declaration
using Promoted = typename detail::Promoted<T, U>::type;
^
/opt/homebrew/include/QtCore/qglobal.h:691:31: error: no template named 'Promoted' in namespace 'QTypeTraits'
constexpr inline QTypeTraits::Promoted<T, U> qMin(const T &a, const U &b)
~~~~~~~~~~~~~^
/opt/homebrew/include/QtCore/qglobal.h:693:28: error: no template named 'Promoted' in namespace 'QTypeTraits'
using P = QTypeTraits::Promoted<T, U>;
~~~~~~~~~~~~~^
/opt/homebrew/include/QtCore/qglobal.h:694:5: error: unknown type name 'P'
P _a = a;
^
/opt/homebrew/include/QtCore/qglobal.h:695:5: error: unknown type name 'P'
P _b = b;
^
/opt/homebrew/include/QtCore/qglobal.h:699:31: error: no template named 'Promoted' in namespace 'QTypeTraits'
constexpr inline QTypeTraits::Promoted<T, U> qMax(const T &a, const U &b)
~~~~~~~~~~~~~^
/opt/homebrew/include/QtCore/qglobal.h:701:28: error: no template named 'Promoted' in namespace 'QTypeTraits'
using P = QTypeTraits::Promoted<T, U>;
~~~~~~~~~~~~~^
/opt/homebrew/include/QtCore/qglobal.h:702:5: error: unknown type name 'P'
P _a = a;
^
/opt/homebrew/include/QtCore/qglobal.h:703:5: error: unknown type name 'P'
P _b = b;
^
/opt/homebrew/include/QtCore/qglobal.h:707:31: error: no template named 'Promoted' in namespace 'QTypeTraits'
constexpr inline QTypeTraits::Promoted<T, U> qBound(const T &min, const U &val, const T &max)
~~~~~~~~~~~~~^
/opt/homebrew/include/QtCore/qglobal.h:710:31: error: no template named 'Promoted' in namespace 'QTypeTraits'
constexpr inline QTypeTraits::Promoted<T, U> qBound(const T &min, const T &val, const U &max)
~~~~~~~~~~~~~^
/opt/homebrew/include/QtCore/qglobal.h:713:31: error: no template named 'Promoted' in namespace 'QTypeTraits'
constexpr inline QTypeTraits::Promoted<T, U> qBound(const U &min, const T &val, const T &max)
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
解决方案
一个很晚的答案,但我的解决方案是卸载 Qt6,这样你就只有 Qt5。您可能同时安装了两者。两者的头文件可能会发生冲突和混淆。要正确地这样做:
- 查找您使用 Homebrew 安装的所有 Qt 版本:
brew list | grep qt
# You should see something like "qt qt@5"
- 删除
qt
(这是 Qt6)
brew uninstall qt
您现在应该只剩下 Qt5 了。再次尝试构建,看看问题是否已解决。
推荐阅读
- prometheus - 使用录制规则时的 Prometheus 过滤
- python - 日期问题 - 字符串索引必须是整数
- kubernetes - 网站在 GKE - Kubernetes 上响应“默认后端 - 404”
- sqlite - Flutter Sqlite,从数据库表中选择一个结果
- c - 选择排序未正确排序
- azure-devops - 用于 azure devops 管道构建中 API 测试的本地 SqlServer 数据库连接
- c# - 切换/加载场景时如何使用单例?
- powershell - 使用 Powershell 获取 *.lrc 以匹配它们的 *.flac 名称
- scala - spark Scala 数据框选择
- python - 错误是什么意思以及如何解决 - “ValueError:查询数据维度必须匹配训练数据维度”