0

I have pasted the code from microsoft example. But when I run the program I have the errors:

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

How can I fix it? Help me, please!

Gradess
  • 143
  • 1
  • 1
  • 6
  • this question is not duplicated. it asked what is static library of GetPhysicalMonitorsFromHMONITOR function. – Amir Jan 21 '22 at 15:21

1 Answers1

1

You need to look in the documentation here:

GetPhysicalMonitorsFromHMONITOR function

and locate this:

Library... Dxva2.lib

In your C++ code you add somewhere:

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

And it pulls the library into linking process resolving the errors you quoted.

Roman R.
  • 68,205
  • 6
  • 94
  • 158