Unsolved C1083: Cannot open include fhile: 'QtSql': No such file or directory
-
I just installed 5.7.0, created a Qt Widgets Application, added sql (QT += core gui sql) to the .pro file and added '#include <QtSql>' to the mainwindow.h file. No other changes made. When compiling with 'MSVC2013 64 ' in Debug mode I receive the error noted. When I change to release mode, the program compiles and runs. I manually ran the qmake file with the basic parameters noted in the documentation. No effect. Any ideas on how to resolve?
-
Hi and welcome to devnet,
How did you install Qt ?
The include failure looks pretty strange. What if you include something like QSqlTableModel ?
-
Qt installation was with the main Windows install program with binary code. Changing the include file produced the same error except for the file name. Thank you.
-
In the pro file add:
QT+= sql
-
@NickV As noted the sql was added in the .pro file.
-
Did you check your Qt installation folder content ?
-
@SGaist The sub folders in the Qt 5.7 folder look normal. The appropriate bin folder has Qt5Sql.dll and Qt5Sqld.dll files. Anything else I should look for? During installation, I chose only 5.7 packages. Would older ones be helpful?
-
Build -> Run qmake
and build again. Always do that when you edit .pro file. -
@Chris-Kawa That does seem to have resolved the issue. Thank you.
-
The good all classic qmake re-run… :D