1 添加包含目录:项目属性 -> C/C++ -> 常规 -> 附加包含目录,添加以下目录
C:\Qt\include\
C:\Qt\include\QtGui
C:\Qt\include\QtCore
C:\Qt\include\Qt2 附加库目录:项目属性 -> 链接器 -> 常规 ->附加目录库,添加以下目录
C:\Qt\lib3 测试一下
#include
#include
int main(int argc,char *argv[])
{
QString s("hello");
system("pause");
return 0;
}
4 编译结果:
1> 所有输出均为最新。
1>111.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: __thiscall QString::~QString(void)" (__imp_??1QString@@QAE@XZ),该符号在函数 _main 中被引用
1>111.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: __thiscall QString::QString(char const *)" (__imp_??0QString@@QAE@PBD@Z),该符号在函数 _main 中被引用
1>C:\Project\C++\222\Debug\222.e