我有功能findId(常量QString的&名)抛出我coompilation过程中出现错误:错误LNK2019:解析外部符号:: FindWindow函数()函数
error LNK2019: unresolved external symbol [email protected] referenced in function "private: unsigned int__thiscall MainClass::findId(class QString const &)"([email protected]@@[email protected]@@Z)
mainclass.cpp:
WId MainClass::findId(const QString& name)
{
return (WId) ::FindWindow(NULL, (TCHAR*)name.utf16());
}
我不知道问题出在哪里,因为我之前在其他项目中使用过这个代码,并且在那里工作。也许我错过了什么。
如果重新标记您的问题,您将得到更好的答案。什么语言?什么OS?什么技术?什么编译器? 'lnk2019'不是一个有用的标签。 – 2014-10-22 08:16:31
FindWindow需要Windows.h和User32.lib – 2014-10-22 08:26:18
链接器无法找到':: FindWindow(...)'的定义。你确定有吗? – CinCout 2014-10-22 08:26:22