PDA

View Full Version : Compiler can't find #include<QSqlDatabase>



Arpan
8th February 2006, 18:10
hello everybody,

i'm new to QT and trying to develop a database application.

i use QT 4.0.1 opensource edition.

when i try to include <QSqlDatabase> with #include preprocessor, i get an error while compiling.

The error is :

QSqlDatabase : No such file or ..

I don't know what's wrong... i tried to compile my code on WinXP as well as on Linux, but i received the same error.

Please guide me, I don't have any idea why this is happening. :confused:

jacek
8th February 2006, 18:32
Add "QT += sql" to your .pro file.

crocus
9th February 2006, 00:40
#include <QtSql/QSqlDatabase>

jacek
9th February 2006, 01:36
#include <QtSql/QSqlDatabase>
"#include <QSqlDatabase>" also should work, provided that Qt was configured properly.

blackliteon
9th February 2006, 07:28
"#include <QSqlDatabase>" also should work, provided that Qt was configured properly.
We need buid qt with database suport, and need to know thats some of mysql-driver was built. Sure, if there no sqldrivers (compiled dinamically or statically) it'll not work

Arpan
17th February 2006, 12:52
thanks everybody for ur help..

i'll reinstall and try to configure QT correctly.

jacek
17th February 2006, 13:05
i'll reinstall and try to configure QT correctly.
Start from adding "QT += sql" to your .pro file, as it takes less time to check (not mentioning that Qt is probably already configured correctly).