Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Build errors with Qt 6.7.0
Qt 6.11 is out! See what's new in the release blog

Build errors with Qt 6.7.0

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 6 Posters 1.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    CodePoet
    wrote on last edited by
    #1

    Hello all,

    I have just upgraded to 6.7.0 and my builds (both MinGW and MSVC22019) are now littered with the following 3 build issue when I build my subdirs projects.

    Is anyone getting the same issue? Any thoughts/guidance would be very welcome.

    Errors:

    C:\Qt\6.7.0\msvc2019_64\include\QtCore\qcompare.h:228: error: C2248: 'Qt::partial_ordering::partial_ordering': cannot access private member declared in class 'Qt::partial_ordering'
    C:\Qt\6.7.0\msvc2019_64\include\QtCore/qcompare.h(228): error C2248: 'Qt::partial_ordering::partial_ordering': cannot access private member declared in class 'Qt::partial_ordering'
    C:\Qt\6.7.0\msvc2019_64\include\QtCore/qcompare.h(189): note: see declaration of 'Qt::partial_ordering::partial_ordering'
    C:\Qt\6.7.0\msvc2019_64\include\QtCore/qcompare.h(65): note: see declaration of 'Qt::partial_ordering'
    C:\Qt\6.7.0\msvc2019_64\include\QtCore\qcompare.h:408: error: C2248: 'Qt::partial_ordering::partial_ordering': cannot access private member declared in class 'Qt::partial_ordering'
    C:\Qt\6.7.0\msvc2019_64\include\QtCore/qcompare.h(408): error C2248: 'Qt::partial_ordering::partial_ordering': cannot access private member declared in class 'Qt::partial_ordering'
    C:\Qt\6.7.0\msvc2019_64\include\QtCore/qcompare.h(189): note: see declaration of 'Qt::partial_ordering::partial_ordering'
    C:\Qt\6.7.0\msvc2019_64\include\QtCore/qcompare.h(65): note: see declaration of 'Qt::partial_ordering'
    C:\Qt\6.7.0\msvc2019_64\include\QtCore\qcompare.h:411: error: C2248: 'Qt::weak_ordering::weak_ordering': cannot access private member declared in class 'Qt::weak_ordering'
    C:\Qt\6.7.0\msvc2019_64\include\QtCore/qcompare.h(411): error C2248: 'Qt::weak_ordering::weak_ordering': cannot access private member declared in class 'Qt::weak_ordering'
    C:\Qt\6.7.0\msvc2019_64\include\QtCore/qcompare.h(377): note: see declaration of 'Qt::weak_ordering::weak_ordering'
    C:\Qt\6.7.0\msvc2019_64\include\QtCore/qcompare.h(220): note: see declaration of 'Qt::weak_ordering'

    KR

    CodePoet

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      I remember threads on the development mailing list about these elements. Can you reduce your code to a minimal state that triggers this issue ? You might also want to check the bug report system to see if there's already something related.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • G Offline
        G Offline
        Gertio
        wrote on last edited by Gertio
        #3

        I have the same issue. I have posted a bug report here:
        https://bugreports.qt.io/browse/QTBUG-123934

        1 Reply Last reply
        0
        • J Offline
          J Offline
          jtooker
          wrote on last edited by jtooker
          #4

          We were having this issue in just one of our projects. We use Visual Studio 2022 17.9.5 Professional with toolset v143.

          Our problem was having

          using namespace std; before #include <QDateTime>

          Putting using namespace std; after all our includes fixed the issue.

          1 Reply Last reply
          1
          • S Offline
            S Offline
            steveliao
            wrote on last edited by
            #5

            I have the same issue. It errors out when I use C++ 20 as the language standard. If I turn back to C++ 17, it's gone.

            It is annoying as I want to use some other features of other packages that are only supported in C++20.

            1 Reply Last reply
            0
            • N Offline
              N Offline
              Neil Xu
              wrote on last edited by Neil Xu
              #6

              This is apparently not a Qt bug. You could blame MS Visual Studio for not being smart enough to figure out the partial_ordering's namespace ownership. However, after all, it is your code that confuses the MS Visual Studio.

              The answer is obvious, you have written somewhere in your .h files "using namespace std;". And since std::partial_ordering is made available in c++20, it caused a naming collision with Qt 6.7's partial_ordering.

              Here's a guide how to fix the issue. Search in your project of "using namespace std;" in all header files. Avoid using "using namespace std;", at least not in the header files!

              Explicitly write code like std::string instead of string, etc.  Alternatively, you might be able to take a shortcut by adding alias e.g. "using string = std::string;" or other alias whereever you need.

              Bottomline, don't simply pollute your code base with "using namespace std;"

              It should solve your problem.

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved