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?
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.