1、QT += printsupport
在演练《Qt4图形设计与嵌入式开发》中ImageView的过程中,出现错误:
Error 1 error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall QPrinter::~QPrinter(void)" (__imp_??1QPrinter@@UAE@XZ) referenced in function "private: void __thiscall ezXpns::on_loginButton_clicked(void)" (? on_loginButton_clicked@ezXpns@@AAEXXZ) (path)\TestBuild_April3\TestBuild\ezxpns.obj TestBuild Error 2 error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall QPrinter::QPrinter(enum QPrinter::PrinterMode)" (__imp_?? 0QPrinter@@QAE@W4PrinterMode@0@@Z) referenced in function "private: void __thiscall ezXpns::on_loginButton_clicked(void)" (?on_loginButton_clicked@ezXpns@@AAEXXZ) (path)\TestBuild_April3\TestBuild\ezxpns.obj TestBuild
经过分析,我知道是QPrinter有问题,但是不知道如果解决,Google后,找到了解决方案,在项目的.pro文件中加入QT += printsupport就ok了。
2、QT+=sql
当要进行数据库的操作时,请务必记住加入QT+=sql。