VS2017添加CyAPI.lib报错:error LNK2019

来源:互联网 发布:晚会随机抽奖软件 编辑:程序博客网 时间:2024/05/20 05:24

VS2017添加CyAPI.lib的时候出现error LNK2019提示,如下:


1>CyAPI.lib(CyAPI.obj) : error LNK2019: 无法解析的外部符号 __imp__SetupDiDestroyDeviceInfoList@4,该符号在函数 "public: unsigned char __thiscall CCyUSBDevice::DeviceCount(void)" (?DeviceCount@CCyUSBDevice@@QAEEXZ) 中被引用
1>CyAPI.lib(CyAPI.obj) : error LNK2019: 无法解析的外部符号 __imp__SetupDiEnumDeviceInterfaces@20,该符号在函数 "public: unsigned char __thiscall CCyUSBDevice::DeviceCount(void)" (?DeviceCount@CCyUSBDevice@@QAEEXZ) 中被引用
1>CyAPI.lib(CyAPI.obj) : error LNK2019: 无法解析的外部符号 __imp__SetupDiGetClassDevsA@16,该符号在函数 "public: unsigned char __thiscall CCyUSBDevice::DeviceCount(void)" (?DeviceCount@CCyUSBDevice@@QAEEXZ) 中被引用
1>CyAPI.lib(CyAPI.obj) : error LNK2019: 无法解析的外部符号 __imp__SetupDiGetDeviceInterfaceDetailA@24,该符号在函数 "public: bool __thiscall CCyUSBDevice::CreateHandle(unsigned char)" (?CreateHandle@CCyUSBDevice@@QAE_NE@Z) 中被引用
1>CyAPI.lib(CyAPI.obj) : error LNK2019: 无法解析的外部符号 _sprintf,该符号在函数 "public: void __thiscall CCyUSBDevice::UsbdStatusString(unsigned long,char *)" (?UsbdStatusString@CCyUSBDevice@@QAEXKPAD@Z) 中被引用




-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

解决方法:

给VS2017添加附加依赖库:下面2个,(SETUPAPI.lib是必须加的)。
SetupAPI.lib                               VS2017比VS2015需要多加个这个库。。。
legacy_stdio_definitions.lib          VS2015和VS2017中必须加的 。。
阅读全文
0 0