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. QtSql Postgress MinGW8 compilation error.
QtWS25 Last Chance

QtSql Postgress MinGW8 compilation error.

Scheduled Pinned Locked Moved Solved General and Desktop
qtsqlmingw
11 Posts 3 Posters 1.2k Views
  • 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.
  • A artwaw
    29 Sept 2021, 07:38

    Good morning,
    I run into a problem building a program on Windows, Qt 5.15.2, MinGW8 x64.

    C:\Qt\Tools\mingw810_64\lib\gcc\x86_64-w64-mingw32\8.1.0\include\c++\thread:273: error: no match for 'operator==' (operand types are 'std::thread::native_handle_type' {aka 'ptw32_handle_t'} and 'std::thread::native_handle_type' {aka 'ptw32_handle_t'})
    In file included from C:/Qt/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/future:39,
                     from C:\Qt\5.15.2\mingw81_64\include\QtCore/qthread.h:51,
                     from C:\Qt\5.15.2\mingw81_64\include\QtCore/QtCore:245,
                     from ..\BalancerStringEditor\dbconnector.h:9,
                     from ..\BalancerStringEditor\dbconnector.cpp:6:
    C:/Qt/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/thread: In function 'bool std::operator==(std::thread::id, std::thread::id)':
    C:/Qt/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/thread:273:26: error: no match for 'operator==' (operand types are 'std::thread::native_handle_type' {aka 'ptw32_handle_t'} and 'std::thread::native_handle_type' {aka 'ptw32_handle_t'})
         return __x._M_thread == __y._M_thread;
                ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
    

    I developed program for Mac, where it (after some fun getting Postgres plugin to work) compiles and runs successfully. Decision has been made to port it to Windows, so my .pro file now looks like this:

    QT       += core gui sql
    
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    
    CONFIG += c++11
    CONFIG += sdk_no_version_check
    
    (...)
    
    macx:{
        LIBS += -L$$PWD/../libs/pgsql/lib/ -lpq.5
        INCLUDEPATH += $$PWD/../libs/pgsql/include
        DEPENDPATH += $$PWD/../libs/pgsql/include
    }
    
    win32:{
        LIBS += -L$$PWD/../libs/psql-win/lib/ -lpq.5
        INCLUDEPATH += $$PWD/../libs/pgsql-win/include
        DEPENDPATH += $$PWD/../libs/pgsql-win/include
    }
    

    This is the same version Postgres (11) downloaded for different platforms.
    Any ideas?

    J Offline
    J Offline
    jsulm
    Lifetime Qt Champion
    wrote on 29 Sept 2021, 07:58 last edited by
    #2

    @artwaw Where in your code does this error come from?
    Is PostgreSQL lib 32bit or 64bit?

    https://forum.qt.io/topic/113070/qt-code-of-conduct

    A 1 Reply Last reply 29 Sept 2021, 08:01
    0
    • J jsulm
      29 Sept 2021, 07:58

      @artwaw Where in your code does this error come from?
      Is PostgreSQL lib 32bit or 64bit?

      A Offline
      A Offline
      artwaw
      wrote on 29 Sept 2021, 08:01 last edited by
      #3

      @jsulm x64. It comes from the first include of QtSql related class.

      I have a single class that deals with database stuff, DBConnector. In the dump from the compiler you can see the include is at line 9:

      C:\Qt\Tools\mingw810_64\lib\gcc\x86_64-w64-mingw32\8.1.0\include\c++\thread:273: error: no match for 'operator==' (operand types are 'std::thread::native_handle_type' {aka 'ptw32_handle_t'} and 'std::thread::native_handle_type' {aka 'ptw32_handle_t'})
      In file included from C:/Qt/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/future:39,
                       from C:\Qt\5.15.2\mingw81_64\include\QtCore/qthread.h:51,
                       from C:\Qt\5.15.2\mingw81_64\include\QtCore/QtCore:245,
                       from ..\BalancerStringEditor\dbconnector.h:9,
      

      For more information please re-read.

      Kind Regards,
      Artur

      J 1 Reply Last reply 29 Sept 2021, 08:03
      0
      • A artwaw
        29 Sept 2021, 08:01

        @jsulm x64. It comes from the first include of QtSql related class.

        I have a single class that deals with database stuff, DBConnector. In the dump from the compiler you can see the include is at line 9:

        C:\Qt\Tools\mingw810_64\lib\gcc\x86_64-w64-mingw32\8.1.0\include\c++\thread:273: error: no match for 'operator==' (operand types are 'std::thread::native_handle_type' {aka 'ptw32_handle_t'} and 'std::thread::native_handle_type' {aka 'ptw32_handle_t'})
        In file included from C:/Qt/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/future:39,
                         from C:\Qt\5.15.2\mingw81_64\include\QtCore/qthread.h:51,
                         from C:\Qt\5.15.2\mingw81_64\include\QtCore/QtCore:245,
                         from ..\BalancerStringEditor\dbconnector.h:9,
        
        J Offline
        J Offline
        jsulm
        Lifetime Qt Champion
        wrote on 29 Sept 2021, 08:03 last edited by
        #4

        @artwaw I'm not sure MinGW 8.1 is the latest version provided via Qt installer. Can you check and install the latest one (I think it is 8.2)?

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        A 1 Reply Last reply 29 Sept 2021, 08:11
        0
        • J jsulm
          29 Sept 2021, 08:03

          @artwaw I'm not sure MinGW 8.1 is the latest version provided via Qt installer. Can you check and install the latest one (I think it is 8.2)?

          A Offline
          A Offline
          artwaw
          wrote on 29 Sept 2021, 08:11 last edited by
          #5

          @jsulm
          820dc397-037c-47e7-ae84-c2632b8c24a1-image.png

          For more information please re-read.

          Kind Regards,
          Artur

          1 Reply Last reply
          0
          • A Offline
            A Offline
            artwaw
            wrote on 29 Sept 2021, 09:01 last edited by
            #6

            Google search for the error shows quite a few unresolved issues like mine scattered over the web (SO and other places) which doesn't make me feel optimistic.

            In the meantime I redownloaded Postgres libraries (from version 11 there is no x86 version, only x64) but the problem, no surprise here, remains.

            For more information please re-read.

            Kind Regards,
            Artur

            J 1 Reply Last reply 29 Sept 2021, 09:09
            0
            • A artwaw
              29 Sept 2021, 09:01

              Google search for the error shows quite a few unresolved issues like mine scattered over the web (SO and other places) which doesn't make me feel optimistic.

              In the meantime I redownloaded Postgres libraries (from version 11 there is no x86 version, only x64) but the problem, no surprise here, remains.

              J Offline
              J Offline
              jsulm
              Lifetime Qt Champion
              wrote on 29 Sept 2021, 09:09 last edited by
              #7

              @artwaw Did you check Qt bug tracker? Maybe already reported.

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              A 1 Reply Last reply 29 Sept 2021, 09:36
              1
              • J jsulm
                29 Sept 2021, 09:09

                @artwaw Did you check Qt bug tracker? Maybe already reported.

                A Offline
                A Offline
                artwaw
                wrote on 29 Sept 2021, 09:36 last edited by
                #8

                @jsulm I did, looks like it is not reported.

                I wonder if I should report it, considering we are not getting any bug fixes for 5.15 anyway or just wait for 6.02, switch and see if it is still broken... Anyway, looks like I either have to find workaround (I don't think I have skills to do that considering that I don't know what to do) or convince parties involved that this tool of mine will not work on Windows. Crap...

                For more information please re-read.

                Kind Regards,
                Artur

                1 Reply Last reply
                0
                • C Offline
                  C Offline
                  Christian Ehrlicher
                  Lifetime Qt Champion
                  wrote on 29 Sept 2021, 14:18 last edited by
                  #9

                  What exactly are you trying to achieve? I don't see where the Qt postgresql plugin is involved here nor is dbconnector.h any official Qt source so how should we know what you're doing here?
                  I would say you include a header before #include <QtCore/QtCore> (which itself is a bad idea - it includes all QtCore header files for no reason) which messes up the whole stuff. Move it up as first include (and please don't include QtCore/QtCore but only the needed headers).

                  Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                  Visit the Qt Academy at https://academy.qt.io/catalog

                  A 1 Reply Last reply 29 Sept 2021, 15:10
                  1
                  • C Christian Ehrlicher
                    29 Sept 2021, 14:18

                    What exactly are you trying to achieve? I don't see where the Qt postgresql plugin is involved here nor is dbconnector.h any official Qt source so how should we know what you're doing here?
                    I would say you include a header before #include <QtCore/QtCore> (which itself is a bad idea - it includes all QtCore header files for no reason) which messes up the whole stuff. Move it up as first include (and please don't include QtCore/QtCore but only the needed headers).

                    A Offline
                    A Offline
                    artwaw
                    wrote on 29 Sept 2021, 15:10 last edited by
                    #10

                    @Christian-Ehrlicher That is new.
                    I always use QtCore to avoid the plethora of single class includes. Same with QtWidgets or QtGui. Apparently that doesn't work properly when working with external includes. It also sheds a bit of light on my other problems in the past... I simply was not aware.

                    Anyway, now all works properly.

                    I just assumed that it is Postgres messing up, as this is the only new thing in the workflow that worked for me till now.

                    Lesson learned, thank you @Christian-Ehrlicher

                    For more information please re-read.

                    Kind Regards,
                    Artur

                    1 Reply Last reply
                    0
                    • C Offline
                      C Offline
                      Christian Ehrlicher
                      Lifetime Qt Champion
                      wrote on 29 Sept 2021, 15:12 last edited by Christian Ehrlicher
                      #11

                      @artwaw said in QtSql Postgress MinGW8 compilation error.:

                      I always use QtCore to avoid the plethora of single class includes.

                      Looks like you have enough time...

                      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                      Visit the Qt Academy at https://academy.qt.io/catalog

                      1 Reply Last reply
                      2

                      11/11

                      29 Sept 2021, 15:12

                      • Login

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