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.

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.
  • artwawA Offline
    artwawA Offline
    artwaw
    wrote on last edited by
    #1

    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?

    For more information please re-read.

    Kind Regards,
    Artur

    jsulmJ 1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 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

      artwawA 1 Reply Last reply
      1
      • artwawA artwaw

        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?

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on 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

        artwawA 1 Reply Last reply
        0
        • jsulmJ jsulm

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

          artwawA Offline
          artwawA Offline
          artwaw
          wrote on 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

          jsulmJ 1 Reply Last reply
          0
          • artwawA artwaw

            @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,
            
            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on 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

            artwawA 1 Reply Last reply
            0
            • jsulmJ jsulm

              @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)?

              artwawA Offline
              artwawA Offline
              artwaw
              wrote on 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
              • artwawA Offline
                artwawA Offline
                artwaw
                wrote on 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

                jsulmJ 1 Reply Last reply
                0
                • artwawA artwaw

                  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.

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #7

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

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

                  artwawA 1 Reply Last reply
                  1
                  • jsulmJ jsulm

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

                    artwawA Offline
                    artwawA Offline
                    artwaw
                    wrote on 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
                    • Christian EhrlicherC Offline
                      Christian EhrlicherC Offline
                      Christian Ehrlicher
                      Lifetime Qt Champion
                      wrote on 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

                      artwawA 1 Reply Last reply
                      1
                      • Christian EhrlicherC Christian Ehrlicher

                        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).

                        artwawA Offline
                        artwawA Offline
                        artwaw
                        wrote on 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
                        • Christian EhrlicherC Offline
                          Christian EhrlicherC Offline
                          Christian Ehrlicher
                          Lifetime Qt Champion
                          wrote on 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

                          • Login

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