Issue compiling geant4 on macos with qt enabled

Geant4 Version: 11.4.2
Operating System: macOS Sequoia 15.7.7
Compiler/Version: Apple clang version 17.0.0 (clang-1700.6.4.2)
CMake Version: 4.3.4

I’m trying to compile geant4 on an M4 mac and it fails when qt is enabled, using qt 6.11.1. I get this error message:

In file included from /Users/sflynn/geant4/geant4-v11.4.2/source/visualization/OpenGL/src/G4OpenGLImmediateQt.cc:36:
In file included from /Users/sflynn/geant4/geant4-v11.4.2/source/visualization/OpenGL/include/private/G4OpenGLImmediateQtViewer.hh:36:
In file included from /Users/sflynn/geant4/geant4-v11.4.2/source/visualization/OpenGL/include/private/G4OpenGLQtViewer.hh:43:
/opt/homebrew/lib/QtCore.framework/Headers/qobject.h:429:23: error: no member named 'qobject_cast_helper' in namespace 'QtPrivate'
  429 |     return QtPrivate::qobject_cast_helper<T>(object);
      |            ~~~~~~~~~~~^
/opt/homebrew/lib/QtCore.framework/Headers/qobject.h:429:43: error: 'T' does not refer to a value
  429 |     return QtPrivate::qobject_cast_helper<T>(object);
      |                                           ^
/opt/homebrew/lib/QtCore.framework/Headers/qobject.h:426:17: note: declared here
  426 | template <class T>
      |                 ^
/opt/homebrew/lib/QtCore.framework/Headers/qobject.h:437:23: error: no member named 'qobject_cast_helper' in namespace 'QtPrivate'
  437 |     return QtPrivate::qobject_cast_helper<T>(object);
      |            ~~~~~~~~~~~^
/opt/homebrew/lib/QtCore.framework/Headers/qobject.h:437:43: error: 'T' does not refer to a value
  437 |     return QtPrivate::qobject_cast_helper<T>(object);
      |                                           ^
/opt/homebrew/lib/QtCore.framework/Headers/qobject.h:432:17: note: declared here
  432 | template <class T>
      |                 ^

Hi Stephanie

I too am using Qt 6.11.1 on Mac…but Mac OS Tahoe 26.5.1. I recall that home-brew changed something. I’m not an expert here, but it was something to do with how they supported both Qt6 and Qt5. Geant4 v11.4 should build with Qt6 by default. What I’m saying is, Qt 6.11.1 (which is the latest Qt) might not work with Sequoia 15.7.7.

I can only suggest updating your Mac. Sorry not to be more helpful.

John