Visual studio compile wpd project code error solution

When using PortableDeviceApi to obtain usb device information and communication, an error will appear

error LNK2001: 无法解析的外部符号 _IID_IPortableDeviceValues
error LNK2001: 无法解析的外部符号 _CLSID_PortableDeviceValues
error LNK2001: 无法解析的外部符号 _CLSID_PortableDeviceManager
error LNK2001: 无法解析的外部符号 _CLSID_PortableDeviceServiceFTM

The error is as follows
Need to be in Project->Properties->Linker->Input->Additional Dependencies

enter

ShlWapi.lib;PortableDeviceGuids.lib;%(AdditionalDependencies)

insert image description here

Guess you like

Origin blog.csdn.net/qq_36535153/article/details/125244035