CGAL Install MacOS QT5

Viewed 202

I am trying to build one of the cgal demos from the developer website.

I have installed cgal using brew install cgal. I also have installed qt5 version 5.15.2 using brew install qt5

However, when I try to build a demo (I am looking at the same one given in the example $HOME/CGAL-5.2.1/examples/Triangulation_) I get a long error from make that I don't know how to interpret.

My computer is running OS X 11.0.1. Clang is version 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.
1 Answers

A very late answer but my solution was to uninstall Qt6 so that you only have Qt5. It is possible you may have both installed. Header files from both can conflict and confuse make. To properly do so:

  1. Find all of the Qt versions you have installed with Homebrew:
brew list | grep qt
# You should see something like "qt qt@5"
  1. Remove qt (which is Qt6)
brew uninstall qt

You should now have only Qt5 left. Try doing the build again, see if the issue is fixed.

Related