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

Compiling universal binaries in Qt Creator error

    XMLWordPrintable

Details

    • macOS
    • 1298e1fff53d60661f95bc18a3a824216627bd26 (qt/qtdoc/dev) 0ef5e861d6287331449002f6694d8b1c3097c98a (qt/qtdoc/6.2)

    Description

      Using the Qt guide for universal builds:

      https://doc.qt.io/qt-6/macos.html#architectures

      I added the following line to .pro file:

      QMAKE_APPLE_DEVICE_ARCHS="x86_64 arm64"

      This is on Mac OS Big Sur 11.6, Xcode 12.5.1, Qt Creator 5.0.2, and latest Qt 6.2.0

      This is the error:

      /Library/Developer/CommandLineTools/usr/bin/clang++ -pipe -stdlib=libc++ -O2 -g -std=gnu++1z  -arch x86_64  -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -mmacosx-version-min=10.14 -Wall -Wextra -dM -E -o moc_predefs.h ../../../../Qt/6.2.0/macos/mkspecs/features/data/dummy.cpp
      clang: error: cannot use 'c++-cpp-output' output with multiple -arch options
      make: *** [moc_predefs.h] Error 1
      make: *** Waiting for unfinished jobs....
      13 warnings generated.
      12:56:19: The process "/usr/bin/make" exited with code 2.
      Error while building/deploying project P3 (kit: Qt 6.2.0 for macOS)
      When executing step "Make"
      

      The app compiles fine if I comment out the 1 added line in the pro file for multiple archs. To eliminate the possibility it's our code, I opened a fresh copy of the example project "~/Qt/Examples/Qt-6.2.0/multimediawidgets/player/player.pro"

      Ran it as is, compiled and ran fine. Added the single line for universal builds/multiple arch and same error.

      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
            wesblake Wesley Krasko
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes