Building for iOS: fatal error: 'fp.h' file not found
-
I am seeing this trying to build qt-5.15.16 for iOS from source.
Host: macOS Sequoia 15.13.2
Xcode: Version 16.3 (16E140)
Configure line:./configure -prefix /Users/patrick/dev/familydiagram/lib/Qt/5.15.16-ios -xplatform macx-ios-clang -opensource -confirm-license -nomake examples -nomake tests -skip qtactiveqt -skip qtcanvas3d -skip qtgamepad -skip qtremoteobjects -skip qtscript -skip qtspeech -skip qtvirtualkeyboard -skip qtwayland -skip qtwebview -skip qtwebengine -skip qtwebchannel -skip qtwebglplugin -skip qtwebsockets -skip qtserialbus -skip qtserialport
Error:
cd 3rdparty/libpng/ && ( test -e Makefile || /Users/patrick/dev/familydiagram/lib/qt-everywhere-src-ios-5.15.16/qtbase/bin/qmake -o Makefile /Users/patrick/dev/familydiagram/lib/qt-everywhere-src-ios-5.15.16/qtbase/src/3rdparty/libpng/libpng.pro ) && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile /Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile.Debug all /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -c -pipe -g -fPIC -std=gnu11 -arch arm64 -arch x86_64 -Xarch_arm64 -miphoneos-version-min=12.0 -Xarch_arm64 -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.4.sdk -Xarch_x86_64 -mios-simulator-version-min=12.0 -Xarch_x86_64 -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.4.sdk -fobjc-nonfragile-abi -fobjc-legacy-dispatch -fvisibility=hidden -w -fno-exceptions -DQT_NO_LINKED_LIST -DQT_NO_JAVA_STYLE_ITERATORS -DQT_COMPILER_SUPPORTS_SSE2 -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DGLES_SILENCE_DEPRECATION -DPNG_ARM_NEON_OPT=0 -DPNG_POWERPC_VSX_OPT=0 -DPNG_IMPEXP= -D_CRT_SECURE_NO_DEPRECATE -DQT_NO_DYNAMIC_CAST -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I. -I../../../mkspecs/common/uikit -I. -I../../../mkspecs/macx-ios-clang -o .obj/debug/png.o png.c In file included from png.c:14: ./pngpriv.h:524:16: fatal error: 'fp.h' file not found 524 | # include <fp.h> | ^~~~~~ 1 error generated. make[4]: *** [.obj/debug/png.o] Error 1 make[3]: *** [debug-all] Error 2 make[2]: *** [sub-3rdparty-libpng-make_first] Error 2 make[1]: *** [sub-src-make_first] Error 2 make: *** [module-qtbase-make_first] Error 2
-
I am also encountering this issue when building from source for qt 5.15.2
Host: macOS Sequoia 15.4 (24E248)
Xcode: Version 16.3 (16E140)I was able to patch the issue on my end by making the edit to
pngpriv.h
from this commit https://github.com/qt/qtbase/commit/528032c02771ddc35d054ff8d414b382904b607e#diff-55d511ae5f1abd6828d0c0dc1e20806b2014b8f792c41998bbf12f73b37411c3R559 -
I got a response in my QT Guerra issue report saying that it is recommended practice to always compile your own static third-party libraries. That way keeping them up-to-date. So in this case that would mean cross compiling Lib PNG and then passing the correct options to your configure script so that it is linked in.
-
Ah that makes sense. Thanks @patrickkidd