Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QSqldatabase and QT creator



  • HI All,

    I am working on QSqldatabase and i have following problem.
    I have create connection and but when i compile my code i am facing compilation error that QSqldatabase not declared. I have added in pro file QT += sql but i think something is missing.

    Is there any dll that will add support for QSql ?

    Thanks,
    Neel


  • Moderators

    You are using are using QSqlDatabase, and not QSqldatabase, right?



  • @#include <QSqlDatabase>@

    and as mlong said notice the capitalisation you are using is incorrect.



  • Did you add the SQL module in your .pro file for the Qt configuration?
    @
    QT+= SQL
    @



  • Also make sure that qmake has been re-run since you added QT += SQL so that the Makefiles (or equivalent) have been updated to include the necessary include and library paths etc.


Log in to reply