3

I have been trying to build Qt as shared libraries for iOS. Have anyone been able to successfully build it from source? If so, what version of XCode, Qt and configure options did you use?

I have tried all four combinations of these:

  • XCode 7.3.1 & 8.3.3
  • Qt 5.8 & 5.9

I configure Qt before building with these options:

./configure -shared -xplatform macx-ios-clang -debug-and-release -sdk iphoneos9.3 -opensource -confirm-license -c++11 -no-compile-examples -nomake tools -nomake examples -nomake tests -skip qt3d -skip qtandroidextras -skip qtcanvas3d -skip qtcharts -skip qtconnectivity -skip qtdatavis3d -skip qtdoc -skip qtgraphicaleffects -skip qtimageformats -skip qtmultimedia -skip qtnetworkauth -skip qtpurchasing -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qttools -skip qttranslations -skip qtvirtualkeyboard -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip qtwinextras -skip qtx11extras -skip qtxmlpatterns

This is what Qt prints back:

   Configure summary

Building on:   macx-clang (x86_64, CPU features: cx16 mmx sse sse2 sse3 ssse3)
Building for:  macx-ios-clang (arm64, CPU features: neon)

Build options:
  Configuration .......... accessibility audio-backend build_all c++11 concurrent cross_compile dbus debug debug_and_release freetype full-config getaddrinfo getifaddrs harfbuzz iconv ipv6ifname large-config largefile medium-config minimal-config neon no-libdl no-pkg-config opengl opengles2 pcre png qpa qpa qt_framework reduce_exports release securetransport shared small-config ssl system-zlib
  Build parts ............ libs
  Mode ................... debug and release; default link: debug
  Using sanitizer(s)...... none
  Using C++ standard ..... c++11
  Using gold linker....... no
  Using new DTAGS ........ no
  Using PCH .............. no
  Using LTCG ............. no
  Target compiler supports:

Qt modules and options:
  Qt D-Bus ............... yes (loading dbus-1 at runtime)
  Qt Concurrent .......... yes
  Qt GUI ................. yes
  Qt Widgets ............. yes
  Large File ............. yes
  QML debugging .......... yes
  Use system proxies ..... no

Support enabled for:
  Accessibility .......... yes
  ALSA ................... no
  CUPS ................... no
  Evdev .................. no
  FontConfig ............. no
  FreeType ............... yes (bundled copy)
  Glib ................... no
  GStreamer .............. no
  GTK theme .............. no
  HarfBuzz ............... yes (bundled copy)
  Iconv .................. yes
  ICU .................... no
  Image formats: 
    GIF .................. yes (plugin, using bundled copy)
    JPEG ................. yes (plugin, using bundled copy)
    PNG .................. yes (in QtGui, using bundled copy)
  libinput................ no
  Logging backends: 
    journald ............... no
    syslog   ............... no
  mtdev .................. no
  Networking: 
    CoreWlan ............. no
    getaddrinfo .......... yes
    getifaddrs ........... yes
    IPv6 ifname .......... yes
    libproxy.............. no
    OpenSSL .............. no
    SecureTransport ...... yes
  OpenGL / OpenVG: 
    EGL .................. no
    OpenGL ............... yes (OpenGL ES 2.0+)
    OpenVG ............... no
  PCRE ................... yes (bundled copy)
  pkg-config ............. no 
  PulseAudio ............. no
  QPA backends: 
    DirectFB ............. no
    EGLFS ................ no
      EGLFS i.MX6 ........ no
      EGLFS i.MX6 Wayland. no
      EGLFS EGLDevice .... no
      EGLFS GBM .......... no
      EGLFS Mali ......... no
      EGLFS Raspberry Pi . no
      EGLFS X11 .......... no
    LinuxFB .............. no
    Mir client............ no
    XCB .................. no
  Session management ..... yes
  SQL drivers: 
    DB2 .................. no
    InterBase ............ no
    MySQL ................ no
    OCI .................. no
    ODBC ................. no
    PostgreSQL ........... no
    SQLite 2 ............. no
    SQLite ............... yes (plugin, using bundled copy)
    TDS .................. no
  tslib .................. no
  udev ................... no
  xkbcommon-x11........... no
  xkbcommon-evdev......... no
  zlib ................... yes (system library)

/Users/patrickhisnibrataas/qt5/qt.pro:97: Cannot find feature qt_configure

Qt is now configured for building. Just run 'make'.
Once everything is built, you must run 'make install'.
Qt will be installed into /usr/local/QtBuild

Prior to reconfiguration, make sure you remove any leftovers from
the previous build.

But all the builds always fails. I assume there should be some combination of XCode and configure options that should work with a specific Qt version?

m7913d
  • 10,244
  • 7
  • 28
  • 56
uniquenamehere
  • 1,869
  • 3
  • 31
  • 60
  • Which error messages do you get? Why do you want a shared library for iOS? [A static library may be better suited for iOS](https://stackoverflow.com/questions/27809352/are-ios-8-apps-with-embedded-dylibs-allowed-on-the-app-store). – m7913d Jun 18 '17 at 09:15
  • @Phat Have you already done it? – Macias Oct 10 '17 at 14:27
  • Yes. It should work with 5.9.2 at least (if released yet) – uniquenamehere Oct 10 '17 at 14:28
  • @Phat It compiles, but now I have many problems with dependencies when releasing simple test app. You have any expierience with such things? – Macias Oct 12 '17 at 18:29
  • You need to add the frameworks in the pro file – uniquenamehere Oct 12 '17 at 18:58
  • @Phat I know but it still not working. Do you have any working examples? I would be very grateful. – Macias Oct 13 '17 at 12:20
  • Then I do not know why it is not working. I currently do not have any example code. – uniquenamehere Oct 13 '17 at 13:44
  • @Phat Hmm, maybe you can tell me how do you add frameworks to .pro? Second thing is that you tested your app on Simulator or on physical device? – Macias Oct 13 '17 at 15:00
  • Do you guys have any news on this? I'm using 5.12 rc1 now and the build works (after some small fixups) but on launching, QtGui library cannot be found. I also don't see it in the xcarchive package bundle. – guruz Nov 29 '18 at 08:45

0 Answers0