Error c1083 QtSql
-
Your code can't be compiled but it has nothing to do with the
<QtSql>
include.You should first clean it.
Then, avoid using module wide includes. They are easy to use for quick samples or tests but otherwise they pull in everything the module contains which means that your compile time increases because the compiler will parse
all
the module includes. Basically: include what you use where you use it.Then, please re-read the QSqlDatabase class documentation. You're going to make a wrong usage of it.
-
@123456789 Help with what?
-
Your code compiled fine for me.
i had to remove the
Qtdatabase: i;
from login.h
as its not needed and was also wrong syntax.
Should have been QSqlDatabase i;
But You dont need to keep the database around as doc says.You really should study the Documentation as @SGaist says.
Without overall understanding of how the SQL system works, it will be hard
on you to do anything useful. -
@mrjj
I just put this as an example.
but even if you remove this line of code it gives error@123456789 What error?
-
@123456789 There is no such header file, it is called Qsql, http://doc.qt.io/qt-5/qsql.html
Edit: it is QtSql
C/C++ is case sensitive you know -
@123456789 There is no such header file, it is called Qsql, http://doc.qt.io/qt-5/qsql.html
Edit: it is QtSql
C/C++ is case sensitive you know -
@123456789 Show us Screenshot of .pro file.
i think you did not write in your .pro file.
if not then add it as below:QT += sql //Case-Sensitive
-
@123456789 How did you install Qt?
-
-
-
@123456789 After adding sql in your pro file: did you rerun qmake?
You should try following:- Delete build directory
- Run qmake
- Build
Also: why did you install 2 MinGW versions?
-
@123456789
Separate the code, put in next line QT += sql in .pro file,
Save all,
Close the qt project,
go to project file location,
delete ex3.pro.user,
open ex3 project,
Choose appropriate kit when configure project,
rebuild the project.