Question

I'm trying to compile a qt project (within Qt Creator 2.7.0 on Qt 5.0.2) and I keep getting linker errors that have to do with the QtSQL library (KioskBridge is the file/class that I am using sql in):

kioskbridge.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl QSqlDatabase::QSqlDatabase(void)" (__imp_??0QSqlDatabase@@QEAA@XZ) referenced in function "public: __cdecl KioskBridge::KioskBridge(class Html5ApplicationViewer *)" (??0KioskBridge@@QEAA@PEAVHtml5ApplicationViewer@@@Z)

My pro file includes QT += sql, but that doesn't seem to make it link with the appropriate libraries.

Any ideas?

Était-ce utile?

La solution

After you modify the .pro file you will need to run qmake (that will re-generate the makefiles with the right dependencies) and only after that you can successfully link your application with the newly added modules.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top