Skip to content

qsql.h - no such file or directory error when compiling for Qt 6.5.2 #195

@githubuser0xFFFF

Description

@githubuser0xFFFF

Hi,

I just managed to build the library for Qt 6.5.2 with MinGW 64 - thank you for supporting Qt6. There was only one single problem with the headers generated by the pythonqt_generator.exe for Qt 6.5.2. When building the extension library, I hit the following error:

In file included from ..\..\..\generated_cpp_65\com_trolltech_qt_sql\com_trolltech_qt_sql0.cpp:1:
..\..\..\generated_cpp_65\com_trolltech_qt_sql\com_trolltech_qt_sql0.h:23:10: fatal error: qsql.h: No such file or directory
   23 | #include <qsql.h>
      |          ^~~~~~~~
compilation terminated.

I could fix the issue by manually replacing #include <qsql.h> in com_trolltech_qt_sql0.h by #include <QSql>.

If I include the header file qsql.h in my Qt5 application for testing, I see the following warning:

C:\CodingXP\Qt\5.15.2\mingw81_64\include\QtSql/qsql.h:4:4: warning: #warning Header <QtSql/qsql.h> is deprecated. Please include <QtSql/qtsqlglobal.h> instead. [-Wcpp]
    4 | #  warning Header <QtSql/qsql.h> is deprecated. Please include <QtSql/qtsqlglobal.h> instead.
      |    ^~~~~~~

So I think qsql.h is not available in Qt6 anymore.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions