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

Make Qt Quick 3D Physics compile with GCC 12.2

    XMLWordPrintable

Details

    • c45929079c (qt/qtquick3dphysics/dev) 17b6625229 (qt/qtquick3dphysics/6.4)

    Description

      Currently, the build fails with OpenSUSE Tumbleweed and gcc (SUSE Linux) 12.2.1 20220830:

      Qt6.4/qtquick3dphysics/src/3rdparty/PhysX/source/physx/src/NpAggregate.cpp
      In file included from /home/USERNAME/Qt6.4/qtquick3dphysics/src/3rdparty/PhysX/pxshared/include/foundation/PxSimpleTypes.h:40,
      from /home/USERNAME/Qt6.4/qtquick3dphysics/src/3rdparty/PhysX/pxshared/include/foundation/Px.h:37,
      from /home/USERNAME/Qt6.4/qtquick3dphysics/src/3rdparty/PhysX/source/foundation/include/Ps.h:35,
      from /home/USERNAME/Qt6.4/qtquick3dphysics/src/3rdparty/PhysX/source/common/src/CmPhysXCommon.h:36,
      from /home/USERNAME/Qt6.4/qtquick3dphysics/src/3rdparty/PhysX/source/physx/src/NpAggregate.h:34,
      from /home/USERNAME/Qt6.4/qtquick3dphysics/src/3rdparty/PhysX/source/physx/src/NpAggregate.cpp:31:
      /home/USERNAME/Qt6.4/qtquick3dphysics/src/3rdparty/PhysX/pxshared/include/foundation/PxPreprocessor.h:499:15: error: expected unqualified-id before 'const'
      499 | Class(const Class&); \
      | ^~~~~
      /home/USERNAME/Qt6.4/qtquick3dphysics/src/3rdparty/PhysX/source/common/src/CmPreallocatingPool.h:399:9: note: in expansion of macro 'PX_NOCOPY'
      399 | PX_NOCOPY(BufferedPreallocatingPool<T>)
      | ^~~~~~~~~
      

       

      Looks like an upstream issue. The following code is a simplification of the real PhysX code, but it compiles fine on older versions of GCC.

      #include <iostream>
      
      #define PX_NOCOPY(Class) \
      protected: \
          Class(const Class&); \
          Class& operator=(const Class&);
      
      template<class T>
      class BufferedPreallocatingPool
      {
      private:
          T m_var;
          PX_NOCOPY(BufferedPreallocatingPool<T>)
      
      public:
          BufferedPreallocatingPool() : m_var{} { std::cout << "Allocated " << m_var << std::endl; }
      };
      
      int main()
      {
          BufferedPreallocatingPool<int> x;
      }
      

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-107547
          # Subject Branch Project Status CR V

          Activity

            People

              jokarlss Jonas Karlsson
              skoh-qt Sze Howe Koh
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes