【问题标题】:CGAL Install MacOS QT5CGAL 安装 MacOS QT5
【发布时间】:2021-03-23 04:03:43
【问题描述】:

我正在尝试构建cgal 演示from the developer website 之一。

我已经使用brew install cgal 安装了cgal。 我还使用brew install qt5 安装了qt5 5.15.2 版

但是,当我尝试构建演示时(我正在查看示例 $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++ qt clang cgal


    【解决方案1】:

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

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

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

    【讨论】:

    • 你也可以只做brew unlink qt,让它安装但不符号链接到主要的/usr/local/层次结构。当我遇到类似问题时,取消链接对我有用。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-06-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多