编译 vshadow(卷影复制服务 SDK 的一部分)时出现链接器错误
当尝试为 VSS SDK 编译 c++ 项目时,我收到此链接器错误
Error 1 error LNK2019: unresolved external symbol "long __stdcall ShouldBlockRevert(wchar_t const *,bool *)" (?ShouldBlockRevert@@YGJPB_WPA_N@Z) referenced in function "public: void __thiscall VssClient::RevertToSnapshot(struct _GUID)" (?RevertToSnapshot@VssClient@@QAEXU_GUID@@@Z) revert.obj vshadow
ShouldBlockRevert 使用了两次,一次是在顶部声明时,一次是实际使用时。
在这里声明:
HRESULT APIENTRY ShouldBlockRevert(IN LPCWSTR wszVolumeName, OUT bool* pbBlock);
并在这里使用:
CHECK_COM(::ShouldBlockRevert(Snap.m_pwszOriginalVolumeName, &bBlock));
if (bBlock)
{
ft.WriteLine(L"Revert is disabled on the volume %s because of writers",
Snap.m_pwszOriginalVolumeName);
return;
}
抱歉,我不太擅长 C++。
I am getting this linker error when trying to compile the c++ project for the VSS SDK
Error 1 error LNK2019: unresolved external symbol "long __stdcall ShouldBlockRevert(wchar_t const *,bool *)" (?ShouldBlockRevert@@YGJPB_WPA_N@Z) referenced in function "public: void __thiscall VssClient::RevertToSnapshot(struct _GUID)" (?RevertToSnapshot@VssClient@@QAEXU_GUID@@@Z) revert.obj vshadow
The ShouldBlockRevert is used twice, once when it is declared at the top, and once when it is actually used.
Declared here:
HRESULT APIENTRY ShouldBlockRevert(IN LPCWSTR wszVolumeName, OUT bool* pbBlock);
and used here:
CHECK_COM(::ShouldBlockRevert(Snap.m_pwszOriginalVolumeName, &bBlock));
if (bBlock)
{
ft.WriteLine(L"Revert is disabled on the volume %s because of writers",
Snap.m_pwszOriginalVolumeName);
return;
}
Sorry, I'm not that good with c++.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据这篇博客文章:
According to this blog post: