- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm building a C++ DLL for our FX3 board. When I try to build the code, I get the following link errors. How do I correct this?
1>CyAPI.lib(CyAPI.obj) : error LNK2019: unresolved external symbol __imp__SetupDiDestroyDeviceInfoList@4 referenced in function "public: unsigned char __thiscall CCyUSBDevice::DeviceCount(void)" (?DeviceCount@CCyUSBDevice@@QAEEXZ)
1>CyAPI.lib(CyAPI.obj) : error LNK2019: unresolved external symbol __imp__SetupDiEnumDeviceInterfaces@20 referenced in function "public: unsigned char __thiscall CCyUSBDevice::DeviceCount(void)" (?DeviceCount@CCyUSBDevice@@QAEEXZ)
1>CyAPI.lib(CyAPI.obj) : error LNK2019: unresolved external symbol __imp__SetupDiGetClassDevsA@16 referenced in function "public: unsigned char __thiscall CCyUSBDevice::DeviceCount(void)" (?DeviceCount@CCyUSBDevice@@QAEEXZ)
1>CyAPI.lib(CyAPI.obj) : error LNK2019: unresolved external symbol __imp__SetupDiGetDeviceInterfaceDetailA@24 referenced in function "public: bool __thiscall CCyUSBDevice::CreateHandle(unsigned char)" (?CreateHandle@CCyUSBDevice@@QAE_NE@Z)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think you must add "Setupapi.lib" to your list of libraries.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Same error here:
Error 5 error LNK2019: unresolved external symbol __imp__SetupDiGetDeviceInterfaceDetailA@24 referenced in function "public: bool __thiscall CCyUSBDevice::CreateHandle(unsigned char)" (?CreateHandle@CCyUSBDevice@@QAE_NE@Z) P:\Colibiri - USB 3.0 Debug\TestSW_new_driver\CyAPI.lib(CyAPI.obj)
Error 4 error LNK2019: unresolved external symbol __imp__SetupDiGetClassDevsA@16 referenced in function "public: unsigned char __thiscall CCyUSBDevice::DeviceCount(void)" (?DeviceCount@CCyUSBDevice@@QAEEXZ) P:\Colibiri - USB 3.0 Debug\TestSW_new_driver\CyAPI.lib(CyAPI.obj)
Error 3 error LNK2019: unresolved external symbol __imp__SetupDiEnumDeviceInterfaces@20 referenced in function "public: unsigned char __thiscall CCyUSBDevice::DeviceCount(void)" (?DeviceCount@CCyUSBDevice@@QAEEXZ) P:\Colibiri - USB 3.0 Debug\TestSW_new_driver\CyAPI.lib(CyAPI.obj)
Error 2 error LNK2019: unresolved external symbol __imp__SetupDiDestroyDeviceInfoList@4 referenced in function "public: unsigned char __thiscall CCyUSBDevice::DeviceCount(void)" (?DeviceCount@CCyUSBDevice@@QAEEXZ) P:\Colibiri - USB 3.0 Debug\TestSW_new_driver\CyAPI.lib(CyAPI.obj)
Error 6 error LNK1120: 4 unresolved externals P:\Colibiri - USB 3.0 Debug\TestSW_new_driver\Debug\TestSW.exe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Same answer: I think you must add "Setupapi.lib" to your list of libraries.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have done it,but also Error 5 error LNK2019: unresolved external symbol __imp__SetupDiGetDeviceInterfaceDetailA@24 referenced in function "public: bool __thiscall CCyUSBDevice::C
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Which version of Visual Studio are you using?
Have you tried compiling the examples that come as part of SuiteUSB and tried compiling them. Just make sure your Visual Studio environment is configured properly.
Regards,
Anand