Why can't I find cfgmgr32.lib in the Windows SDK?

允我心安 提交于 2019-12-19 03:44:20

问题


I'm trying to use the Configuration Manager API, e.g., CM_Get_Device_ID. The documentation says to link to cfgmgr32.lib.

However, when I do this, I get an error message from the linker:

Error 1 error LNK1104: cannot open file 'cfgmgr32.lib'

I can't find cfgmgr32.lib anywhere in the Windows SDK.

If I leave out cfgmgr32.lib I get unresolved external symbol errors.

How can I use the Configuration Manager API?


回答1:


If the version of the Windows SDK you are using does not contain cfgmgr32.lib, you should link to setupapi.lib instead. This contains the Configuration Manager functions.

Note that (depending on what you are doing) it may be preferable to use the more recent Setup API instead of the Configuration Manager API.



来源:https://stackoverflow.com/questions/27178969/why-cant-i-find-cfgmgr32-lib-in-the-windows-sdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!