GetPhysicalMonitorsFromHMONITOR不起作用[重复]

问题描述 投票:-1回答:1

我已经粘贴了microsoft example的代码。但是当我运行程序时,我有错误:

error LNK2019: unresolved external symbol _GetNumberOfPhysicalMonitorsFromHMONITOR@8 referenced in function _main

error LNK2019: unresolved external symbol _GetPhysicalMonitorsFromHMONITOR@12 referenced in function _main

error LNK2019: unresolved external symbol _DestroyPhysicalMonitors@8 referenced in function _main

我该如何解决?请帮帮我!

c++ visual-studio winapi
1个回答
1
投票

你需要在这里查看文档:

GetPhysicalMonitorsFromHMONITOR function

并找到这个:

图书馆...... Dxva2.lib

在你的C ++代码中添加一个地方:

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

它将库拉入链接过程,解决您引用的错误。

© www.soinside.com 2019 - 2024. All rights reserved.