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

[qt6] namespaced static builds broken

    XMLWordPrintable

Details

    • 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

            hjk hjk
            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