Qt6 and QGis integration erro of qt5 library
Unsolved
Qt 6
-
**OS : windows 10 64 bit x64
Qt Creator 15.0.0
Based on Qt 6.8.1 (MSVC 2022, x86_64)Qt compiler : MSVC2022 64 bit
QGIS : Online (OSGeo4W) installer: many version installed by OSGeo4W installer with qgis-qt6-dev**
profile .
QT += core gui xml greaterThan(QT_MAJOR_VERSION, 4): QT += widgets CONFIG += c++17 # Include paths for QGIS and Qt INCLUDEPATH += C:/OSGeo4W/apps/qgis-qt6-dev/include # INCLUDEPATH += C:/OSGeo4W/include # Libraries for QGIS, GDAL, PROJ, and Qt LIBS += -LC:/OSGeo4W/apps//lib -lqgis_core -lqgis_gui -lqgis_app -lqgis_native -lqgis_analysis -lqgis_server # LIBS += -LC:/OSGeo4W/lib -lgdal # LIBS += -LC:/OSGeo4W/lib -lproj # 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 += \ main.cpp \ mainwindow.cpp HEADERS += \ mainwindow.h FORMS += \ mainwindow.ui # Default rules for deployment. qnx: target.path = /tmp/$${TARGET}/bin else: unix:!android: target.path = /opt/$${TARGET}/bin !isEmpty(target.path): INSTALLS += target
main.cpp file
#include "mainwindow.h" #include <QApplication> #include <qgsapplication.h> int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; w.show(); return a.exec(); }
Issue:- Giving error of qt5 dll file why? qt5xml, qt5svg, qt5sql.dll etc.
-
@Aman55 said in Qt6 and QGis integration erro of qt5 library:
Issue:- Giving error of qt5 dll file why? qt5xml, qt5svg, qt5sql.dll etc.
So you somehow loaded the Qt5 qgis stuff. You can not mix it. It's up to you to make sure to use the correct ones - what should we do here?
You can check which dlls are loaded from which dependency with e.g. Dependencies