首页 > 解决方案 > CGAL 安装 MacOS QT5

问题描述

我正在尝试从开发人员网站cgal构建其中一个演示。

我已经cgal使用brew install cgal. 我还使用安装了qt55.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.

标签: c++qtclangcgal

解决方案


一个很晚的答案,但我的解决方案是卸载 Qt6,这样你就只有 Qt5。您可能同时安装了两者。两者的头文件可能会发生冲突和混淆。要正确地这样做:

  1. 查找您使用 Homebrew 安装的所有 Qt 版本:
brew list | grep qt
# You should see something like "qt qt@5"
  1. 删除qt(这是 Qt6)
brew uninstall qt

您现在应该只剩下 Qt5 了。再次尝试构建,看看问题是否已解决。


推荐阅读