使用RegOpenKeyEx 等windows注册函数时,编译无法解析问题
error LNK2019: 无法解析的外部符号 __imp__RegQueryValueExW@24,该符号在函数 "private: static class QString __cdecl QextSerialEnumerator::getRegKeyValue(struct HKEY__ *,unsigned short const *)" (?getRegKeyValue@QextSerialEnumerator@@CA?AVQString@@PAUHKEY__@@PBG@Z) 中被引用
Qt中使用RegOpenKeyEx 等windows注册函数时,编译报以上错误,查MSDN的帮助文档,使用RegOpenKeyEx文档中说明如下:
Requirements
Windows NT/2000: Requires Windows NT 3.1 or later.
Windows 95/98: Requires Windows 95 or later.
Header: Declared in Winreg.h; include Windows.h.
Library: Use Advapi32.lib.
pro文件中添加LIBS += -lAdvapi32 注意头文件.h 中要添加#include <qt_windows.h> 编译通过
2307



被折叠的 条评论
为什么被折叠?



