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

Compilation fails with -static on MacOS X due to qtmacextras

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P1: Critical
    • Resolution: Done
    • Affects Version/s: 5.2.0 RC1
    • Fix Version/s: None
    • Component/s: Core: Plugins
    • Labels:
      None
    • Environment:
      Tested on:
      - Mac OS X 10.6 + XCode 4.2.0
      - Mac OS X 10.9 + XCode 5.0.2

      and qt-everywhere-opensource-src-5.2.0-rc1 package
    • Platform/s:
      macOS

      Description

      There is some duplicate code in:
      qtbase/src/plugins/platforms/cocoa/qmacmime.h (and corresponding .mm)
      qtmacextras/include/QtMacExtras/qmacpasteboardmime.h (and corresponding .mm)
      Source code contains this comment:
      qmacmime.h: // Duplicate of QMacPasteboardMime in QtMacExtras. Keep in sync!
      qmacpasteboardmime.h: // Duplicate of QMacPasteboardMime in the Cocoa Platform Plugin. Keep in sync!

      Such hack is not compatible with a static build (build fails).

      if I trash all code except:
      "void qRegisterDraggedTypes(const QStringList &types)"
      in qmacpasteboardmime.mm, build is OK (but because I don't the reason there is duplicate code and because I don't use QMacPasteboardMime, I don't know if such patch is OK for everybody).

      ***

      Using qt-everywhere-opensource-src-5.2.0-rc1.* source package.
      with this config:
      ./configure -release -opensource -confirm-license -static -no-framework
      make

      After some time, I have this error:
      /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -headerpad_max_install_names -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -stdlib=libc++ -mmacosx-version-min=10.7 -o macpasteboardmime.app/Contents/MacOS/macpasteboardmime .obj/main.o .obj/macpasteboardmime_plugin_import.o -L/Users/mymac/qt/qtbase/lib -framework ApplicationServices -framework CoreServices -framework CoreFoundation -framework Foundation -framework Cocoa -framework OpenGL -framework AGL -framework Carbon -L/Users/mymac/qt/qtmacextras/lib -lQt5MacExtras -framework AppKit -L/Users/mymac/qt/qtbase/plugins/platforms -lqcocoa -framework IOKit -lQt5PrintSupport -lQt5PlatformSupport -lQt5Widgets -lQt5Gui -lQt5Core -lz -lm
      duplicate symbol __ZN18QMacPasteboardMimeC2Ec in:
      /Users/mymac/qt/qtmacextras/lib/libQt5MacExtras.a(qmacpasteboardmime.o)
      /Users/mymac/qt/qtbase/plugins/platforms/libqcocoa.a(qmacmime.o)
      duplicate symbol __ZTV18QMacPasteboardMime in:
      /Users/mymac/qt/qtmacextras/lib/libQt5MacExtras.a(qmacpasteboardmime.o)
      /Users/mymac/qt/qtbase/plugins/platforms/libqcocoa.a(qmacmime.o)
      duplicate symbol __ZN18QMacPasteboardMimeD0Ev in:
      /Users/mymac/qt/qtmacextras/lib/libQt5MacExtras.a(qmacpasteboardmime.o)
      /Users/mymac/qt/qtbase/plugins/platforms/libqcocoa.a(qmacmime.o)
      duplicate symbol __ZN18QMacPasteboardMimeD1Ev in:
      /Users/mymac/qt/qtmacextras/lib/libQt5MacExtras.a(qmacpasteboardmime.o)
      /Users/mymac/qt/qtbase/plugins/platforms/libqcocoa.a(qmacmime.o)
      duplicate symbol __ZN18QMacPasteboardMimeD2Ev in:
      /Users/mymac/qt/qtmacextras/lib/libQt5MacExtras.a(qmacpasteboardmime.o)
      /Users/mymac/qt/qtbase/plugins/platforms/libqcocoa.a(qmacmime.o)
      duplicate symbol __ZN18QMacPasteboardMime5countEP9QMimeData in:
      /Users/mymac/qt/qtmacextras/lib/libQt5MacExtras.a(qmacpasteboardmime.o)
      /Users/mymac/qt/qtbase/plugins/platforms/libqcocoa.a(qmacmime.o)
      duplicate symbol __ZTI18QMacPasteboardMime in:
      /Users/mymac/qt/qtmacextras/lib/libQt5MacExtras.a(qmacpasteboardmime.o)
      /Users/mymac/qt/qtbase/plugins/platforms/libqcocoa.a(qmacmime.o)
      duplicate symbol __ZTS18QMacPasteboardMime in:
      /Users/mymac/qt/qtmacextras/lib/libQt5MacExtras.a(qmacpasteboardmime.o)
      /Users/mymac/qt/qtbase/plugins/platforms/libqcocoa.a(qmacmime.o)
      ld: 8 duplicate symbols for architecture x86_64
      clang: error: linker command failed with exit code 1 (use -v to see invocation)
      make[4]: *** [macpasteboardmime.app/Contents/MacOS/macpasteboardmime] Error 1
      make[3]: *** [sub-macpasteboardmime-make_first] Error 2
      make[2]: *** [sub-macextras-make_first] Error 2
      make[1]: *** [sub-examples-make_first] Error 2
      make: *** [module-qtmacextras-make_first] Error 2

        Attachments

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

          Activity

            People

            Assignee:
            sorvig Morten Sørvig
            Reporter:
            zenitram Jérôme Martinez
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes