Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-110621

Link errors (and bundle warning) when building for iOS in Xcode using CMake

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 6.4.2
    • Build System: CMake
    • None
    • MacOS 12.6 on M1 Apple Silicon, Qt Creator 9.0.1, Qt 6.4.2, Apple clang version 13.1.6 (clang-1316.0.21.2.5), XCode 13.4.1
    • iOS/tvOS/watchOS

    Description

      In order to troubleshoot issues I've been having with building an iOS app using Qt 6 + CMake, I've stripped right back to a bare bones app, but even here there are problems.

      To reproduce:

      1. In Qt Creator, New Project... > Qt Quick Application
      2. Name it qt6-cmake-ios and choose the CMake build system
      3. Select Qt 6.4.2 for iOS kit
      4. Select Release build type and run CMake
      5. In Finder, locate the build folder and open qt6-cmake-ios.xcodeproj which opens the project in Xcode.
      6. As per your documentation, there is a problem with CMake regarding building of archives and it is necessary to build the project before generating the archive. (What the documentation doesn't make clear is that specifically the Release build must be built before generating the archive, otherwise the Release-iphoneos folders don't get built.)
        So, in Xcode go to Product > Scheme > Edit Scheme...
      7. Select the appqt6-cmake-ios scheme and the target Any iOS device (arm64)
      8. For Run (on the left) select Release build configuration.
      9. Close the dialog and go to Product > Build For > Running

       

      This fails.

       

      There is 1 warning:

      User-supplied CFBundleIdentifier value 'my.example.com' in the Info.plist must be the same as the PRODUCT_BUNDLE_IDENTIFIER build setting value ''. (in target 'appqt6-cmake-ios' from project 'qt6-cmake-ios')

      Why is this? And does it matter? I can see that within Build settings > Packaging none of the bundle details have come through although they are visible under General and Info.

       

      There are also lots of link errors:

      These look to me like certain frameworks have not been included. (Remember I have built the autogenerated project which includes the default code for including setting target properties such as MACOSX_BUNDLE.)

       

      NB: As a sidenote, I see that regardless of the build type (Debug/Release/etc), for iOS it's always the same build directory build-qt6-cmake-ios-Qt_6_4_2_for_iOS with no -<buildtype> suffix. Is that intentional? And does it matter?

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qtbuildsystem Qt Build System Team
            paulmasri Paul
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes