解决无法链接GetFileVersionInfoSize、GetFileVersionInfo或VerQueryValue

xsvrDlg.obj : error LNK2019: unresolved external symbol _GetFileVersionInfoSizeW@8 referenced in function "public: int __thiscall CXsvrDlg::_UI_SetProductInfo(void)" (?_UI_SetProductInfo@CXsvrDlg@@QAEHXZ)
1>xsvrDlg.obj : error LNK2019: unresolved external symbol _GetFileVersionInfoW@16 referenced in function "public: int __thiscall CXsvrDlg::_UI_SetProductInfo(void)" (?_UI_SetProductInfo@CXsvrDlg@@QAEHXZ)

1>xsvrDlg.obj : error LNK2019: unresolved external symbol _VerQueryValueW@16 referenced in function "public: int __thiscall CXsvrDlg::_UI_SetProductInfo(void)" (?_UI_SetProductInfo@CXsvrDlg@@QAEHXZ)


msdn上说的是:https://msdn.microsoft.com/en-us/library/windows/desktop/ms647005(v=vs.85).aspx

解决无法链接GetFileVersionInfoSize、GetFileVersionInfo或VerQueryValue_第1张图片


实际上链接version.lib即可。

在项目设置中添加或者在代码中添加:

#pragma comment(lib, "version.lib")

你可能感兴趣的:(Windows应用层编程)