Building Qt 5.9 for iOS with shared libraries fails
-
Hi,
as the topic says, I am trying to build Qt 5.9 for iOS from sources, but I am always ending up with error messages about missing symbols.This is my configure command:
sudo ./configure -prefix /Developer/qt/5.9s -xplatform macx-ios-clang -release -shared -nomake examples -nomake tests -opensourcethe first error I get when running make is:
Undefined symbols for architecture armv7:
"_CFArrayAppendValue", referenced from:
QCoreTextFontDatabase::populateFontDatabase() in libQt5FontDatabaseSupport.a(qcoretextfontdatabase.o)
QCoreTextFontDatabase::addApplicationFont(QByteArray const&, QString const&) in libQt5FontDatabaseSupport.a(qcoretextfontdatabase.o)
"_CFArrayContainsValue", referenced from:
getFontDescription(__CTFontDescriptor const*, FontDescription*) in libQt5FontDatabaseSupport.a(qcoretextfontdatabase.o)
"_CFArrayCreateMutable", referenced from:
QCoreTextFontDatabase::addApplicationFont(QByteArray const&, QString const&) in libQt5FontDatabaseSupport.a(qcoretextfontdatabase.o)
(continued)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[5]: *** [../../../../plugins/platforms/libqminimal.dylib] Error 1Does anyone have a hint for me how to fix this? As a workaround, I tried to exclude armv7 from the arch list, but somehow I didn't find the right location to turn it off.
I am working with Xcode 7.2.1 Build version 7C1002, installed SDKS are
OS X SDKs:
OS X 10.11 -sdk macosx10.11
iOS SDKs:
iOS 9.2 -sdk iphoneos9.2
iOS Simulator SDKs:
Simulator - iOS 9.2 -sdk iphonesimulator9.2
tvOS SDKs:
tvOS 9.1 -sdk appletvos9.1
tvOS Simulator SDKs:
Simulator - tvOS 9.1 -sdk appletvsimulator9.1
watchOS SDKs:
watchOS 2.1 -sdk watchos2.1
watchOS Simulator SDKs:
Simulator - watchOS 2.1 -sdk watchsimulator2.1Thanks a lot for your help!
UPDATE: Also tried this build on a fresh Sierra install with latest XCode (Xcode 8.3.3 Build version 8E3004b) and it fails with the exact same error
-
Hi,
Where did you get the source from ?
And why are you using sudo ?
-
Hi,
I downloaded/installed the source via the MaintenanceTool. Without sudo I get permission denied messages during "make" (happens on both machines)
I openend a bug report about this issue: https://bugreports.qt.io/browse/QTBUG-61489
There I atteched a complete build log, perhaps it helps in tracking down the problem.Thanks for helping!
-
Where did you install Qt exactly ?
In any case, you should rather use an out of source build.
-
@Stefankm I get the exact same error as you. I have tried with XCode 7.3.1, 8.2.1 and 8.3.3. Checked out tag v5.9.0.
My configure is:
./configure -prefix /home/mymac/Qt5.9.0 -opensource -confirm-license -release -shared -xplatform macx-ios-clang -appstore-compliant -c++std c++14 -sdk iphoneos10.2 -skip qtwebkit -skip qtwebkit-examples -nomake examples -nomake tests
If you find a solution, please let me know here on this post. I will post if I find the answer as well.
These are my detailed steps:
- MacOS 10.12.5
- perl-5.18.2, Python 2.7.12
- Xcode version 8.2.1. Same as Qt use according to: Qt Tools and Versions
- Clone Qt5 git repository: git clone https://github.com/qt/qt5.git
- Checkout Qt version: git checkout v5.9.0
- Run perl script to checkout submodules etc.: perl init-repository
- Configure: ./configure -prefix /home/mymac/Qt5.9.0 -opensource -confirm-license -release -shared -xplatform macx-ios-clang -appstore-compliant -c++std c++14 -sdk iphoneos10.2 -skip qtwebkit -skip qtwebkit-examples -nomake examples -nomake tests
- Run make: make -j2
-
Please use https://code.qt.io to clone Qt, GitHub is merely a mirror.
And you should really do an out of source build, that will make things easier to handle.
You should rather use the 5.9.1 branch or the 5.9 branch, they will contain the latest fixes.
-
@SGaist
Thanks for your hints. There was indeed a build problem in Qt that was fixed (refer to bug reference above - although I am hitting a new, similiar problem now). What I did for the new build wasgit clone --branch 5.9.1 git://code.qt.io/qt/qt5.git
cd qt5
git checkout 5.9.1
perl init-repository --module-subset=default,-qtwebkit,-qtwebkit-examples,-qtwebengine
cd qtmacextras/
git cherry-pick 13ac2688a4c692bb430d43c87c440f34d2775307
./configure -prefix /Developer/qt/5.9.1/iosd -xplatform macx-ios-clang -release -shared -nomake examples -nomake tests -opensource -confirm-license
make -j 4Would you suggest a diffrent way of building?
Thanks for your help! -
Why did you need that cherry-pick ?
-
Thanks for the feedback and happy coding ! :)