Which gcc are you using? If you built gcc yourself, make sure it has the c
, c++
, objc
, and obj-c++
front-ends enabled, the obj-c++
is not enabled in most gcc builds.
You can also look at the following project that says they have a gcc with improved compatibility with macOS:
https://github.com/iains/gcc-darwin-arm64
There’s also a thread here on a failed attempt to build VTK with gcc on macOS:
Compilation fails on macOS Sonoma with homebrew gcc-13.2
I don’t think that it’s worth attempting. The macOS SDK was created specifically for Apple Clang, which has non-standard extensions and enhancements that gcc does not have.