jeudi 24 septembre 2020

Qt Creator with MinGW 'no match for operator' Error

In order to deploy my project in Windows, I have got the Qt project from Linux and paste all the source files one paste on Windows 7 VM VirtualBox and tried to build it there.

Unfortunately, I am having the following error that I can't find a way to fix. The Qt Creator compiles well the example projects that come with it, but with my project, it pops that errors on many Qt files. And sorry, I don't have enough reputation to post images, so I'll let the links

(https://i.stack.imgur.com/7vBBC.png)

    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.1\mingw81_64\include/QtCore/qthread.h:51,
                     from C:\Qt\5.15.1\mingw81_64\include/QtCore/QtCore:245,
                     from C:\Qt\5.15.1\mingw81_64\include/QtWidgets/QtWidgetsDepends:3,
                     from C:\Qt\5.15.1\mingw81_64\include\QtWidgets/QtWidgets:3,
                     from ..\RaqMed/patientlineedit.h:54,
                     from ..\RaqMed\addappointmentform.h:13,
                     from ..\RaqMed\calendar.cpp:4:
    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;
                ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~

My .pro file:

QT       += core gui
QMAKE_CXXFLAGS  += -IC:\Users\BRUDEL\Desktop\postgresql\include -fpermissive
QMAKE_LFLAGS    += -LC:\Users\BRUDEL\Desktop\postgresql\lib -llibpq

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = RaqMed
TEMPLATE = app

CONFIG += c++11

# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0

SOURCES += \
    addappointmentform.cpp \
    addpatientform.cpp \
    appointmentwidget.cpp \
    bstring.cpp \
    calendar.cpp \
    edittabmodel.cpp \
    main.cpp \
    patient.cpp \
    patientbdmodel.cpp \
    patientdelegate.cpp \
    patientlineedit.cpp \
    qutils.cpp

HEADERS += \
    addappointmentform.h \
    addpatientform.h \
    appointmentwidget.h \
    bstring.h \
    calendar.h \
    edittabmodel.h \
    patient.h \
    patientbdmodel.h \
    patientdelegate.h \
    patientlineedit.h \
    qutils.h

# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

RESOURCES += \
    teste.qrc

FORMS += \
    calendar.ui \
    testes.ui

DISTFILES += \
    capa.png \
    icon0.png \
    icon2.png

I have installed only the following modules of Qt Creator

Qt 5.15.1

MinGW 8.1.0 64-bit
Qt Charts
Qt Debug Information Files

Developer and Designer Tools

Qt Creator 4.13.1 CDB Debugger Support
Debugging Tools for Windows
MinGW 8.1.0 64-bit
Qt Installer Framework 3.2
CMake 3.17.1 64-bit Ninja 1.10.0

I have found this similar question with no awnser "No match for operator" when including QtSql library in QT

I'm also having these messages when opening Qt Creator

(https://i.imgur.com/9ey08pV.png)

Thanks, and sorry for any posting error, I'm not habituated in English writing.

Aucun commentaire:

Enregistrer un commentaire