0

i'm trying to compile a simple Microsoft's example that uses the WimgApi, already installed Windows 7 AIK and Visual Studio 2012 Ultimate.
I've copied the example from here, created a new C++ Console project & setted up the project include/library directories, and pasted the example's code into the project's main.cpp; but, for some reason, when i try to compile the project, it throws me those errors:

error LNK2019: unresolved external symbol _WIMCreateFile@24 referenced in function _wmain
error LNK2019: unresolved external symbol _WIMCloseHandle@4 referenced in function _wmain
error LNK2019: unresolved external symbol _WIMSetTemporaryPath@8 referenced in function _wmain
error LNK2019: unresolved external symbol _WIMCaptureImage@12 referenced in function _wmain
error LNK2019: unresolved external symbol _WIMRegisterMessageCallback@12 referenced in function _wmain
error LNK2019: unresolved external symbol _WIMUnregisterMessageCallback@8 referenced in function _wmain
error LNK1120: 6 unresolved external symbols

What can i do? i've searched for WimgApi related help/examples but there is no much info about it.

  • You need to link against the proper libraries. https://msdn.microsoft.com/en-us/library/Dd851918 This also appears to have plenty of information and some examples. https://learn.microsoft.com/en-us/previous-versions/windows/hardware/imaging/dd851927(v=msdn.10) – Retired Ninja Jul 25 '18 at 02:43
  • Same error, added C:\Program Files\Windows AIK\SDKs\WIMGAPI\AMD64 to additional dependencies list on linker settings but didn't worked – Michael Jauregui Jul 25 '18 at 02:51
  • Well, that is what you need to do. Perhaps you're not compiling for x64, or you missed something. Put `#pragma comment(lib, "")` in your source file. – Retired Ninja Jul 25 '18 at 03:01
  • I've already done that, tried both `#pragma comment(lib,"C:\\Program Files\\Windows AIK\\SDKs\\WIMGAPI\\AMD64\\wimgapi.lib")` and `#pragma comment(lib,"C:/Program Files/Windows AIK/SDKs/WIMGAPI/AMD64/wimgapi.lib")` – Michael Jauregui Jul 25 '18 at 03:06

0 Answers0