Build Failure: unrecognized command-line option '-fapplication-extension'
Solved
Installation and Deployment
-
I'm trying to build Qt on my mac for g++ instead of clang. I am following the provided tutorial. I am able to clone the repo, checkout 6.2.4, initialize the repo, and configure the cmake files. My configure command is as follows:
../qt5/configure -prefix ~/Qt/6.2.4/qt6-gcc -platform macx-g++
I am running into issues when running
cmake --build
I get the error, c++: error: unrecognized command-line option '-fapplication-extension' from:- qtbase/src/3rdparty/harfbuzz-ng/CMakeFiles/BundledHarfbuzz.dir/hb-dummy.cc.o
- qtbase/src/3rdparty/harfbuzz-ng/CMakeFiles/BundledHarfbuzz.dir/src/hb-aat-layout.cc.o
- qtbase/src/3rdparty/harfbuzz-ng/CMakeFiles/BundledHarfbuzz.dir/src/hb-aat-map.cc.o
- qtbase/src/3rdparty/harfbuzz-ng/CMakeFiles/BundledHarfbuzz.dir/src/hb-blob.cc.o
It is using c++ (Homebrew GCC 11.2.0_3) 11.2.0 as the compiler.
Any idea how to fix this? Thanks in advance -
Hi,
This looks like a Mac specific flag that might be only available through clang (not sure though). AFAIR, the macx-g++ mkspec (or equivalent for Qt 6) is mainly there for historical reasons, you may have to modify it to build using gcc.