C++ DLL for FX3 cannot link

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

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)

0 Likes
5 Replies
Anonymous
Not applicable

I think you must add "Setupapi.lib" to your list of libraries.

0 Likes
Anonymous
Not applicable

 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

   
        
   
    How can I work around the problem. This is a blocking problem...   
   
        
   
        
0 Likes
Anonymous
Not applicable

Same answer: I think you must add "Setupapi.lib" to your list of libraries.

0 Likes
Anonymous
Not applicable

I have done it,but also    Error  5  error LNK2019: unresolved external symbol __imp__SetupDiGetDeviceInterfaceDetailA@24 referenced in function "public: bool __thiscall CCyUSBDevice::C

0 Likes
Anonymous
Not applicable

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

0 Likes