Windows 7 shell 函数的链接问题
我正在尝试通过 Windos 7 库 API 枚举文件,例如使用 SHLoadLibraryFromKnownFolder
我正在使用 C++ win32 控制台应用程序并收到链接错误,例如,
Error LNK2019: unresolved external symbol __imp__DSA_DestroyCallback@12 referenced in function "void __cdecl DSA_DestroyCallback(struct _DSA *,int (__stdcall*)(void const *,void *),void *)" (?DSA_DestroyCallback@@YAXPAU_DSA@@P6GHPBXPAX@Z2@Z)
即使我仅 也会出现这些错误#include
我应该向链接器输入添加一些特定的库吗? 谢谢,R。
I'm trying to enumerate files through the Windos 7 library API, e.g. with SHLoadLibraryFromKnownFolder
I'm using a C++ win32 console application and getting link errors, e.g.,
Error LNK2019: unresolved external symbol __imp__DSA_DestroyCallback@12 referenced in function "void __cdecl DSA_DestroyCallback(struct _DSA *,int (__stdcall*)(void const *,void *),void *)" (?DSA_DestroyCallback@@YAXPAU_DSA@@P6GHPBXPAX@Z2@Z)
These errors appear even if I only #include <ShlObj.h>
Should I add some specific library to the linker inputs?
Thanks, R.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
DSA_DestroyCallback
表明您需要链接 Comctl32.lib。The documentation for
DSA_DestroyCallback
states that you need to link against Comctl32.lib.链接器找不到 DSA_DestroyCallback。该函数位于
Comctl32.lib
中。您包含该导入库吗?(如果您使用的是 MSVC,请添加
#pragma comment(lib, "comctl32.lib")
)The linker can't find DSA_DestroyCallback. That function is in
Comctl32.lib
. Did you include that import library?(Add
#pragma comment(lib, "comctl32.lib")
if you are on MSVC)