Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Do Qt 5.12 supports Shared libraries for ios platform?



  • Hi,

    We are trying to port a Qt5 based application to Qt IOS platform. Our application has multiple plugins based of QtPlugin. We use Qt Plugin loader to load them. As Qt Plugin Loader requires plugins to be a dynamically linked libraries, we tried to build qt 5.12 with -shared flag. When we compile the analog clock example shipped with Qt 5.12. It failed with following error.

    Undefined symbols for architecture arm64:
      "lcEventDispatcher()", referenced from:
          _qt_main_wrapper in libqios.a(qioseventdispatcher.o)
          +[QIOSApplicationStateTracker applicationDidFinishLaunching:] in libqios.a(qioseventdispatcher.o)
          user_main_trampoline() in libqios.a(qioseventdispatcher.o)
          +[QIOSApplicationStateTracker applicationWillTerminate] in libqios.a(qioseventdispatcher.o)
          QIOSJumpingEventDispatcher::interruptEventLoopExec() in libqios.a(qioseventdispatcher.o)
    ld: symbol(s) not found for architecture arm64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)

    I would like to know if Qt 5.12 supports shared libraries for iOS platform? If supported what needs to be changed in the example to get compiled correctly. If shared libraries are not supported yet, what approach should i use to port my application with current structure over ios platform.

    Thanks in advance for your time and your valuable advices.


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    It does but you have to build Qt yourself for that. Also note that you will likely have to build the APK yourself currently to add all the dependencies.



  • @SGaist I have built QT by myself, by passing -shared in the configure. But when i compile the example or my application, we get error as mentioned in my post. Do we have to do anything to remove that error?


  • Lifetime Qt Champion

    Can you show the options you passed to configure when building Qt ?



  • @SGaist OffCourse it is like below,

    ./configure -xplatform macx-ios-clang -release -shared -prefix /home/testuser/qt


  • Lifetime Qt Champion

    Note that you can use static plugins within your application. It requires some changes but it might be easier than currently handling a shared build of Qt on iOS.



  • @SGaist Is their any example of dynamically linked ios application which i can refer or it is not fully supported yet?


  • Lifetime Qt Champion

    I'm currently not aware of such a project (but that doesn't mean it doesn't exist) sorry.



  • @tarakm87 Have a look at the bug report QTBUG-75457. There you can find a patch that solves the issue with the undefined lcEventDispatcher. Consider to clean all build files before applying the patch.


Log in to reply