Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Qt 6.3.2 - Building for iOS with shared libraries not possible?
Forum Updated to NodeBB v4.3 + New Features

Qt 6.3.2 - Building for iOS with shared libraries not possible?

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
2 Posts 2 Posters 426 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.
  • J Offline
    J Offline
    jcarlos
    wrote on last edited by
    #1

    Hi,

    I want to create an iOS framework using shared libraries. I can do the same with static linking and that works well with the Qt binaries. I have read in this forum that I need to build Qt from source with the option -shared in order to get a Qt version that can handle dynamic linking. This is the topic where I found that (for Qt 5.12): https://forum.qt.io/topic/98655/do-qt-5-12-supports-shared-libraries-for-ios-platform

    The problem is that I get a message saying explicitly that this is not allowed when I try to build from the 6.3.2 sources.

    This is my configure command:

    ./configure -opensource -confirm-license -release -nomake tests -nomake examples -xplatform macx-ios-clang -shared -prefix /Users/jc/Qt/6.3.2/ios-shared
    

    And this is the result that I get:

    + mkdir -p qtbase
    + cd qtbase
    + exec /Users/jc/Qt/6.3.2/Src/qtbase/configure -top-level -opensource -confirm-license -release -nomake tests -nomake examples -xplatform macx-ios-clang -shared -prefix /Users/jc/Qt/6.3.2/ios-shared
    '/usr/local/Cellar/cmake/3.21.2/bin/cmake' '-DBUILD_SHARED_LIBS=ON' '-DCMAKE_INSTALL_PREFIX=/Users/jc/Qt/6.3.2/ios-shared' '-DQT_QMAKE_TARGET_MKSPEC=macx-ios-clang' '-DCMAKE_C_COMPILER=clang' '-DCMAKE_CXX_COMPILER=clang++' '-DCMAKE_SYSTEM_NAME=iOS' '-DQT_BUILD_TESTS=FALSE' '-DQT_BUILD_EXAMPLES=FALSE' '-DCMAKE_BUILD_TYPE=Release' '-G' 'Ninja' '/Users/jc/Qt/6.3.2/Src'
    -- Using internal CMake iOS toolchain file.
    -- simulator_and_device set to: "ON".
    CMake Error at qtbase/cmake/QtAutoDetect.cmake:14 (message):
      Building Qt for iOS as shared libraries is not supported.
    Call Stack (most recent call first):
      qtbase/cmake/QtAutoDetect.cmake:263 (qt_internal_ensure_static_qt_config)
      qtbase/cmake/QtAutoDetect.cmake:446 (qt_auto_detect_ios)
      CMakeLists.txt:15 (include)
    
    
    -- Configuring incomplete, errors occurred!
    CMake Error at qtbase/cmake/QtProcessConfigureArgs.cmake:963 (message):
      CMake exited with code 1.
    

    I am using macOS 12.6.1 and I have installed all the prerequisites (python, ninja, etc.)

    Can someone please confirm if what I am trying to do is possible? Am I missing something?

    Thanks

    Christian EhrlicherC 1 Reply Last reply
    0
    • J jcarlos

      Hi,

      I want to create an iOS framework using shared libraries. I can do the same with static linking and that works well with the Qt binaries. I have read in this forum that I need to build Qt from source with the option -shared in order to get a Qt version that can handle dynamic linking. This is the topic where I found that (for Qt 5.12): https://forum.qt.io/topic/98655/do-qt-5-12-supports-shared-libraries-for-ios-platform

      The problem is that I get a message saying explicitly that this is not allowed when I try to build from the 6.3.2 sources.

      This is my configure command:

      ./configure -opensource -confirm-license -release -nomake tests -nomake examples -xplatform macx-ios-clang -shared -prefix /Users/jc/Qt/6.3.2/ios-shared
      

      And this is the result that I get:

      + mkdir -p qtbase
      + cd qtbase
      + exec /Users/jc/Qt/6.3.2/Src/qtbase/configure -top-level -opensource -confirm-license -release -nomake tests -nomake examples -xplatform macx-ios-clang -shared -prefix /Users/jc/Qt/6.3.2/ios-shared
      '/usr/local/Cellar/cmake/3.21.2/bin/cmake' '-DBUILD_SHARED_LIBS=ON' '-DCMAKE_INSTALL_PREFIX=/Users/jc/Qt/6.3.2/ios-shared' '-DQT_QMAKE_TARGET_MKSPEC=macx-ios-clang' '-DCMAKE_C_COMPILER=clang' '-DCMAKE_CXX_COMPILER=clang++' '-DCMAKE_SYSTEM_NAME=iOS' '-DQT_BUILD_TESTS=FALSE' '-DQT_BUILD_EXAMPLES=FALSE' '-DCMAKE_BUILD_TYPE=Release' '-G' 'Ninja' '/Users/jc/Qt/6.3.2/Src'
      -- Using internal CMake iOS toolchain file.
      -- simulator_and_device set to: "ON".
      CMake Error at qtbase/cmake/QtAutoDetect.cmake:14 (message):
        Building Qt for iOS as shared libraries is not supported.
      Call Stack (most recent call first):
        qtbase/cmake/QtAutoDetect.cmake:263 (qt_internal_ensure_static_qt_config)
        qtbase/cmake/QtAutoDetect.cmake:446 (qt_auto_detect_ios)
        CMakeLists.txt:15 (include)
      
      
      -- Configuring incomplete, errors occurred!
      CMake Error at qtbase/cmake/QtProcessConfigureArgs.cmake:963 (message):
        CMake exited with code 1.
      

      I am using macOS 12.6.1 and I have installed all the prerequisites (python, ninja, etc.)

      Can someone please confirm if what I am trying to do is possible? Am I missing something?

      Thanks

      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @jcarlos said in Qt 6.3.2 - Building for iOS with shared libraries not possible?:

      The problem is that I get a message saying explicitly that this is not allowed when I try to build from the 6.3.2 sources.

      So what else should we say - when you get an explicit information that it's not possible then this will be the case.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      0

      • Login

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