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

[qt6] namespaced static builds broken

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Fixed
    • Affects Version/s: 6.0.3
    • Fix Version/s: 6.0.4, 6.1.0, 6.2.0
    • Component/s: Core: Resource System
    • Labels:
      None
    • Commits:
      9466b3629a391ae93c4f06d3627e3dc9e10bba9f

      Description

      building qt6 with statically linked qt gives undefined symbols. afaict there are three issues:

       

      ------

      `qRegisterResourceData` is defined inside the qt namespace. this will break code like:

       

      static void initResources()
      {
       Q_INIT_RESOURCE(qcocoaresources);
      }

       

      in qcocoaintegration.mm, which is outside the qt namespace

       

      ------

      `Q_INIT_RESOURCE` generates an entry point inside the qt namespace, which creates undefined symbols like:

       

      Undefined symbols for architecture x86_64:
       "qInitResources_scenegraph_NAMESPACE()", referenced from:
       __GLOBAL__sub_I__ in libQt6Quick.a(qsgdefaultcontext.cpp.o)
       "qInitResources_qcocoaresources_NAMESPACE()", referenced from:
       NAMESPACE::QCocoaIntegration::QCocoaIntegration(NAMESPACE::QList<NAMESPACE::QString> const&) in libqcocoa.a(qcocoaintegration.mm.o)
      ld: symbol(s) not found for architecture x86_64
      clang: error: linker command failed with exit code 1 (use -v to see invocation) 
      

       

       

      the namespace is not correctly applied on the compiled resources, either:

       

      Undefined symbols for architecture x86_64:
       "qInitResources_resources_qmlcache()", referenced from:
       __GLOBAL__sub_I_qmlcache_loader.cpp in qmlcache_loader.cpp.o
      ld: symbol(s) not found for architecture x86_64
      clang: error: linker command failed with exit code 1 (use -v to see invocation)
      

       

       

        Attachments

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

          Activity

            People

            Assignee:
            hjk hjk
            Reporter:
            timblechmann tim blechmann
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes