Qt 6.11 is out! See what's new in the release
blog
Qt 6.11: Can't compile for 'iphonesimulator'
-
Hi,
I try to compile Qt 6.11.x (0, 1, 2) for the iOS simulator. I managed it to run the configuration step, but compiling it failes. Here is the configuration I used:
/opt/Qt/6.11.2/Src/qtbase/configure -top-level LLVM_INSTALL_DIR=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain \ -prefix /Users/user/SDKs/ios-sim-6.11.2 -extprefix /Users/user/SDKs/ios-sim-6.11.2 -release -platform macx-ios-clang \ -qt-host-path /Users/user/projects/Qt6.11.2_ios_sim/HostBuild -sdk iphonesimulator -DCMAKE_OSX_SYSROOT=iphonesimulator \ -skip-tests opengl -- -DQT_HOST_PATH_CMAKE_DIR=/Users/user/projects/Qt6.11.2_ios_sim/HostBuild/qtbase/lib/cmake \ -DCMAKE_OSX_DEPLOYMENT_TARGET=18 -DQT_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_ARCHITECTURES=arm64 \ -DOPENSSL_ROOT_DIR=/Users/user/SDKs/openssl/ssl_3/iossim -DCMAKE_THREAD_LIBS_INIT=-lpthread \ -DCMAKE_HAVE_THREADS_LIBRARY=1 -DCMAKE_USE_PTHREADS_INIT=1 -DTHREADS_PREFER_PTHREAD_FLAG=ON \ -DCMAKE_APPLE_ARCH_SYSROOTS=iphonesimulatorWhile the host build succeeded fine, I get the following error at the moment it starts to compile:
[...] -- Configuration summary has been written to /Users/user/projects/Qt6.11.2_ios_sim/build/config.summary Note: Using static linking will disable the use of dynamically loaded plugins. Make sure to import all needed static plugins, or compile needed modules into the library. Note: Hunspell in Qt Virtual Keyboard is not enabled. Spelling correction will not be available. Note: Hunspell in Qt Virtual Keyboard is not enabled. Spelling correction will not be available. WARNING: QtPdf won't be built. The following configure errors were found: * Missing C++20 compiler support. WARNING: QtWebEngine has warnings. The following configure warnings were found: * No openh264 library with version 2.4.1 or later. Using built-in one * No libavformat library with version 60.16.100 or later. Using built-in one * No libavcodec library with version 60.31.102 or later. Using built-in one * No libavutil library with version 58.29.100 or later. Using built-in one * No vpx library with version 1.10.0 or later. Using built-in one * No opus library with version 1.3.1 or later. Using built-in one * No icu library with version 70 or later. Using built-in one * No re2 library with version 11.0.0 or later. Using built-in one * No libtiff library with version 4.5.0 or later. Using built-in one * No libpng library with version 1.6.0 or later. Using built-in one * No libudev library with version or later. Using built-in one * No harfbuzz library with version 4.3.0 or later. Using built-in one * No glib library with version 2.32.0 or later. Using built-in one WARNING: QtWebEngine won't be built. The following configure errors were found: * AppleClang compiler is not supported. * Static build is not supported. * Build can be done only on Linux, Windows or macOS. * Missing C++20 compiler support. WARNING: Not all build dependencies were found. Skipping building qtopenapi. WARNING: The upstream OpenAPI generator CLI tool was not found. This doesn't affect the build of the generator plugin itself, but examples and tests will fail to build. ERROR: detected a std::atomic implementation that fails for function pointers. Compile test outputs: TEST_atomicfptr output: Change Dir: '/Users/user/projects/Qt6.11.2_ios_sim/build/CMakeFiles/CMakeScratch/TryCompile-B1hynL' Run Build Command(s): /opt/Qt/Tools/Ninja/ninja -v cmTC_9de0e [1/2] /usr/bin/clang++ -DHAVE_atomicfptr -std=c++20 -isysroot /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/Developer/Platforms/iPhoneSimulator.platform -Werror=unguarded-availability-new -arch arm64 -Xarch_arm64 -isysrootiphonesimulator -mios-simulator-version-min=18 -MD -MT CMakeFiles/cmTC_9de0e.dir/src.cxx.o -MF CMakeFiles/cmTC_9de0e.dir/src.cxx.o.d -o CMakeFiles/cmTC_9de0e.dir/src.cxx.o -c /Users/user/projects/Qt6.11.2_ios_sim/build/CMakeFiles/CMakeScratch/TryCompile-B1hynL/src.cxx FAILED: CMakeFiles/cmTC_9de0e.dir/src.cxx.o /usr/bin/clang++ -DHAVE_atomicfptr -std=c++20 -isysroot /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/Developer/Platforms/iPhoneSimulator.platform -Werror=unguarded-availability-new -arch arm64 -Xarch_arm64 -isysrootiphonesimulator -mios-simulator-version-min=18 -MD -MT CMakeFiles/cmTC_9de0e.dir/src.cxx.o -MF CMakeFiles/cmTC_9de0e.dir/src.cxx.o.d -o CMakeFiles/cmTC_9de0e.dir/src.cxx.o -c /Users/user/projects/Qt6.11.2_ios_sim/build/CMakeFiles/CMakeScratch/TryCompile-B1hynL/src.cxx clang++: warning: no such sysroot directory: 'iphonesimulator' [-Wmissing-sysroot] /Users/user/projects/Qt6.11.2_ios_sim/build/CMakeFiles/CMakeScratch/TryCompile-B1hynL/src.cxx:1:11: fatal error: 'atomic' file not found 1 | #include <atomic> | ^~~~~~~~ 1 error generated. ninja: build stopped: subcommand failed. ERROR: The OpenGL functionality tests failed! You might need to modify the OpenGL package search path by setting the OpenGL_DIR CMake variable to the OpenGL library's installation directory. CMake Error at qtbase/cmake/QtBuildInformation.cmake:245 (message): Check the configuration messages for an error that has occurred. Call Stack (most recent call first): qtbase/cmake/QtBuildInformation.cmake:64 (qt_configure_print_summary) qtbase/cmake/QtBaseTopLevelHelpers.cmake:114 (qt_print_feature_summary) qtbase/cmake/QtBaseTopLevelHelpers.cmake:93 (qt_internal_print_top_level_info) CMakeLists.txt:124 (qt_internal_top_level_end) -- Configuring incomplete, errors occurred! CMake Error at /opt/Qt/6.11.2/Src/qtbase/cmake/QtProcessConfigureArgs.cmake:1500 (message): CMake exited with code 1. CMake Error at /opt/Qt/6.11.2/Src/cmake/QtIRProcessHelpers.cmake:173 (message): /opt/Qt/6.11.2/Src/qtbase/configure -top-level LLVM_INSTALL_DIR=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain -prefix /Users/user/SDKs/ios-sim-6.11.2 -extprefix /Users/user/SDKs/ios-sim-6.11.2 -release -platform macx-ios-clang -qt-host-path /Users/user/projects/Qt6.11.2_ios_sim/HostBuild -sdk iphonesimulator -DCMAKE_OSX_SYSROOT=iphonesimulator -skip-tests opengl -- -DQT_HOST_PATH_CMAKE_DIR=/Users/user/projects/Qt6.11.2_ios_sim/HostBuild/qtbase/lib/cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=18 -DQT_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_ARCHITECTURES=arm64 -DOPENSSL_ROOT_DIR=/Users/user/SDKs/openssl/ssl_3/iossim -DCMAKE_THREAD_LIBS_INIT=-lpthread -DCMAKE_HAVE_THREADS_LIBRARY=1 -DCMAKE_USE_PTHREADS_INIT=1 -DTHREADS_PREFER_PTHREAD_FLAG=ON -DCMAKE_APPLE_ARCH_SYSROOTS=iphonesimulator exited with status: 1 Call Stack (most recent call first): /opt/Qt/6.11.2/Src/cmake/QtTopLevelHelpers.cmake:35 (qt_ir_execute_process_and_log_and_handle_error) /opt/Qt/6.11.2/Src/cmake/QtTopLevelHelpers.cmake:57 (qt_tl_run_toplevel_configure) /opt/Qt/6.11.2/Src/cmake/QtTopLevelConfigureScript.cmake:16 (qt_tl_run_main_script) Exiting because of previous errors!It seems it doesn't like the atomic function pointers the way it's implemented.
Are my configuration settings wrong?
Can I work around this error?
Has somebody already compiled Qt 6.11 for iOS simulator? And if so, how were the settings?I'm trying on a Mac Mini M1 with MacOS 27. The Mac OS is up to date.
A.T.