Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.8.3
-
None
-
macOS Sequoia 15.5
-
-
89e7facc2 (dev), d12cdac9b (6.10), adeb6090a (6.9), 85dc76a6c (tqtc/lts-6.8)
Description
A basic-template "Qt Widgets" application cross-compiled for iOS fails in the xcodebuild step, due to qmake computing the wrong framework dependencies.
This did not happen in Qt 6.7 and earlier, where all prebuilt iOS libraries were archives (e.g., ios/lib/libQt6Gui.a, with an accompanying libQt6Gui.prl file listing dependencies). In 6.8 and later, most prebuilt iOS libraries are static frameworks, and qmake fails to find the proper .prl file (ios/lib/QtGui.framework/Versions/A/Resources/QtGui.prl). That file is correct, but qmake fails to find it.
Debugging using qmake -d -d shows that qmake looks only in two specific folders inside the prebuilt framework (Resources/ and root), and, failing to find any .prl file there, it resorts to the framework of the same name in /System/Library/Frameworks/ or /Library/Frameworks/. In the case of QtGui.framework and the like, this is a macOS framework installed with Qt Creator, and not valid for iOS builds.
As a result, instead of reading Qt's prebuilt iOS dependency list like this:
QMAKE_PRL_LIBS = $$[QT_INSTALL_PREFIX]/lib/objects-Release/Gui_resources_1/.qt/rcc/qrc_qpdf_init.cpp.o $$[QT_INSTALL_PREFIX]/lib/objects-Release/Gui_resources_2/.qt/rcc/qrc_gui_shaders_init.cpp.o $$[QT_INSTALL_LIBS]/QtGui.framework/QtGui -F$$[QT_INSTALL_LIBS] -framework QtCore -framework IOKit -framework UniformTypeIdentifiers -lm $$[QT_INSTALL_LIBS]/libQt6BundledPcre2.a -framework MobileCoreServices -framework OpenGLES -framework ImageIO -framework CoreFoundation -framework CoreGraphics -framework QuartzCore -framework Foundation $$[QT_INSTALL_LIBS]/libQt6BundledHarfbuzz.a -framework CoreText -framework UIKit $$[QT_INSTALL_LIBS]/libQt6BundledFreetype.a $$[QT_INSTALL_LIBS]/libQt6BundledLibpng.a -lz -framework Metal
it picks up this one from my Mac's macOS library:
QMAKE_PRL_LIBS = -framework Carbon -framework AppKit -framework QtCore -lz -lm -liconv -framework ApplicationServices
qmake writes those invalid libraries into the LIBS variable in Makefile, and Xcode fails as a result.
Workaround: I have been able to make that basic-template Qt Widgets project build successfully by adding a symbolic link inside each of the required prebuilt iOS frameworks (QtCore.framework and QtGui.framework) so that qmake finds the correct .prl file.