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?

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top