Qt 6.3.2 - Building for iOS with shared libraries not possible?
-
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
-
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
@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.