Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. undefined symbols _main when building a shared lib on iOS with Qt::StateMachine
Forum Updated to NodeBB v4.3 + New Features

undefined symbols _main when building a shared lib on iOS with Qt::StateMachine

Scheduled Pinned Locked Moved Unsolved Qt 6
1 Posts 1 Posters 535 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    thamht4190
    wrote on 23 May 2022, 11:21 last edited by
    #1

    I'm migrating our project from Qt5.15.0 to Qt 6.3.0 on iOS. This is the linked issue I've got:

    Undefined symbols for architecture arm64:
    "_main", referenced from:
         user_main_trampoline() in libqios.a(qioseventdispatcher.mm.o)
    

    After a while, I realized that the root cause is I'm building a shared lib which links to Qt::StateMachine while Qt::StateMachine depends on Qt::Gui and Qt::Gui requires a define main() method. I tried to remove this dependency in some cmake files inside <qt_install_path>/6.3.0/ios/lib/cmake/Qt6StateMachine/ folder, my build succeeds now.
    I found out this is an external feature qeventtransition of Qt::StateMachine https://code.qt.io/cgit/qt/qtscxml.git/tree/src/statemachine/CMakeLists.txt?h=6.3.0#n34 then I hope that there is an official way to disable this feature then the dependency between StateMachine and Gui is no longer required.
    Any help to bypass this problem? Thanks!

    1 Reply Last reply
    0

    1/1

    23 May 2022, 11:21

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved