Trying to configure qtbase on macOS-26.3
-
Hello,
I have cloned qtbase from git because I want to explore the examples and I have Qt installed from Home-Brew. When trying to configure building qtbase, I get the error message:
python-3.14.3:0→gav@mbam4:~/VCS/qtbase% ./configure (git)-[dev]- '/opt/homebrew/bin/cmake' '-DQT_INTERNAL_CALLED_FROM_CONFIGURE:BOOL=TRUE' '-G' 'Ninja' '/Users/gav/VCS/qtbase' -- CMAKE_BUILD_TYPE was already explicitly set to: 'Release' CMake Error at cmake/QtPublicAppleHelpers.cmake:1078 (message): Can't determine Xcode version. Is Xcode installed? Error details:However, I have installed XCode 26.2 which has a binary plist configuration file. I can transform this binary file to a readable xml file with the command
plistutil -i ~/Library/Preferences/com.apple.dt.Xcode.plist -o xcode-plist.xmlbut I cannot find anything that looks like an XCode version in this file.
Is the configure script compatible with XCode 26.2?
Thanks in advance.
-
Welcome to the forum.
Directly addressing the error is with the
xcode-selectcommand to change from the CLI build tools to a full Xcode installation.However this is not the correct way to go about it;
qtbasecan't really be configured standalone. Are you building from a source tarball or from git?(Also, if you just want to build some examples and you already have Qt installed system-wide, there is no need to configure all of Qt source for building. You can just configure and build a single example you are interested in. E.g to build the Widget Gallery example, you can go to
~/VCS/qtbase/examples/widgets/galleryand runqmakeorcmakethere) -
Welcome to the forum.
Directly addressing the error is with the
xcode-selectcommand to change from the CLI build tools to a full Xcode installation.However this is not the correct way to go about it;
qtbasecan't really be configured standalone. Are you building from a source tarball or from git?(Also, if you just want to build some examples and you already have Qt installed system-wide, there is no need to configure all of Qt source for building. You can just configure and build a single example you are interested in. E.g to build the Widget Gallery example, you can go to
~/VCS/qtbase/examples/widgets/galleryand runqmakeorcmakethere) -
Welcome to the forum.
Directly addressing the error is with the
xcode-selectcommand to change from the CLI build tools to a full Xcode installation.However this is not the correct way to go about it;
qtbasecan't really be configured standalone. Are you building from a source tarball or from git?(Also, if you just want to build some examples and you already have Qt installed system-wide, there is no need to configure all of Qt source for building. You can just configure and build a single example you are interested in. E.g to build the Widget Gallery example, you can go to
~/VCS/qtbase/examples/widgets/galleryand runqmakeorcmakethere)@IgKh
I am building from git and as you said after doingsudo xcode-select -s /Applications/Xcode.appI can configure qtbase and do
cmake --build . --parallelHowever, building stops with
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.2.sdk/usr/include/c++/v1/vector:356: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.2.sdk/usr/include/c++/v1/cerrno:33:5: error: <cerrno> tried including <errno.h> but didn't find libc++'s <errno.h> header. This usually means that your header search paths are not configured properly. The header search paths should contain the C++ Standard Library headers before any C Standard Library, and you are probably using compiler flags that make that not be the case. 33 | # error <cerrno> tried including <errno.h> but didn't find libc++'s <errno.h> header. \ | ^ In file included from /Users/gav/VCS/qtbase/src/corelib/compat/removed_api.cpp:13: In file included from /Users/gav/VCS/qtbase/include/QtCore/qmetatype.h:1: In file included from /Users/gav/VCS/qtbase/src/corelib/kernel/qmetatype.h:16: In file included from /Users/gav/VCS/qtbase/include/QtCore/qfloat16.h:1: In file included from /Users/gav/VCS/qtbase/src/corelib/global/qfloat16.h:12: In file included from /Users/gav/VCS/qtbase/include/QtCore/qmath.h:1: /Users/gav/VCS/qtbase/src/corelib/kernel/qmath.h:156:12: error: no matching function for call to 'hypot' 156 | return hypot(x, y, z); | ^~~~~ /Users/gav/VCS/qtbase/src/corelib/global/qfloat16.h:499:21: note: in instantiation of function template specialization 'qHypot<float, float, float>' requested here 499 | return qfloat16(qHypot(float(x), float(y), float(z))); | ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.2.sdk/usr/include/math.h:449:15: note: candidate function not viable: requires 2 arguments, but 3 were provided 449 | extern double hypot(double, double); | ^ ~~~~~~~~~~~~~~ 14 errors generated. [384/1796] Building CXX object src/3rdparty/harf...ndledHarfbuzz.dir/src/hb-subset-table-layout.cc.o ninja: build stopped: subcommand failed.Thanks for the tip on how to build for instance the Widget Gallery example.
-
@IgKh
I am building from git and as you said after doingsudo xcode-select -s /Applications/Xcode.appI can configure qtbase and do
cmake --build . --parallelHowever, building stops with
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.2.sdk/usr/include/c++/v1/vector:356: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.2.sdk/usr/include/c++/v1/cerrno:33:5: error: <cerrno> tried including <errno.h> but didn't find libc++'s <errno.h> header. This usually means that your header search paths are not configured properly. The header search paths should contain the C++ Standard Library headers before any C Standard Library, and you are probably using compiler flags that make that not be the case. 33 | # error <cerrno> tried including <errno.h> but didn't find libc++'s <errno.h> header. \ | ^ In file included from /Users/gav/VCS/qtbase/src/corelib/compat/removed_api.cpp:13: In file included from /Users/gav/VCS/qtbase/include/QtCore/qmetatype.h:1: In file included from /Users/gav/VCS/qtbase/src/corelib/kernel/qmetatype.h:16: In file included from /Users/gav/VCS/qtbase/include/QtCore/qfloat16.h:1: In file included from /Users/gav/VCS/qtbase/src/corelib/global/qfloat16.h:12: In file included from /Users/gav/VCS/qtbase/include/QtCore/qmath.h:1: /Users/gav/VCS/qtbase/src/corelib/kernel/qmath.h:156:12: error: no matching function for call to 'hypot' 156 | return hypot(x, y, z); | ^~~~~ /Users/gav/VCS/qtbase/src/corelib/global/qfloat16.h:499:21: note: in instantiation of function template specialization 'qHypot<float, float, float>' requested here 499 | return qfloat16(qHypot(float(x), float(y), float(z))); | ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.2.sdk/usr/include/math.h:449:15: note: candidate function not viable: requires 2 arguments, but 3 were provided 449 | extern double hypot(double, double); | ^ ~~~~~~~~~~~~~~ 14 errors generated. [384/1796] Building CXX object src/3rdparty/harf...ndledHarfbuzz.dir/src/hb-subset-table-layout.cc.o ninja: build stopped: subcommand failed.Thanks for the tip on how to build for instance the Widget Gallery example.
@gav451 For full building of Qt, I'm not sure that the Xcode generator is even supported. Maybe it is, but I personally build with the Ninja generator. I follow the Linux instructions on this page: https://wiki.qt.io/Building_Qt_6_from_Git. It is possible that there other ways.
But then again, you don't really need to.