WMI Linker Error on x64

I am trying to use the WMI example from msdn:

http://msdn.microsoft.com/en-us/library/windows/desktop/aa384724%28v=vs.85%29.aspx

I copied the last set of code there verbatim to a console application in VS2008. If I have an application in release or debugging for the win32 platform, it compiles (and works) perfectly. If I have this in release or debugging for the x64 platform, I get the following linker errors:

CppConsole.obj : error LNK2001: unresolved external symbol IID_IWbemConfigureRefresher CppConsole.obj : error LNK2001: unresolved external symbol CLSID_WbemRefresher CppConsole.obj : error LNK2001: unresolved external symbol IID_IWbemRefresher CppConsole.obj : error LNK2001: unresolved external symbol CLSID_WbemLocator CppConsole.obj : error LNK2001: unresolved external symbol IID_IWbemLocator fatal error LNK1120: 5 unresolved externals 

I already tried putting wbemuuid.lib in the linker input directly in the project properties, but this did not change the pragma.

Has anyone done this job with x64? Or is there something else I'm doing wrong?

+6
source share
1 answer

I will give RRUZ credit for this, since he / she at least put me on the right path, but since they did not send an answer-response (just a comment), I can not click on them to get a loan.

Basically, due to the working environment in which I work, project directories are configured in a β€œnon-standard” way. There was already a copy of wbemuuid.lib in another directory, which was the wrong version (not x64), and this directory was higher in the list of included libraries, so it never got into the right directory of the Windows Platform library.

So, if you have ever had problems with x86 and x64, as well as with the library, check your directories and check them as well.

+2
source

Source: https://habr.com/ru/post/910934/


All Articles