3 Replies Latest reply on May 7, 2012 5:32 AM by anand.srinivasan.asokan

    C++ DLL for FX3 cannot link

    joanne.dreitzler

      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)

        • 1. Re: C++ DLL for FX3 cannot link
          martin.maurer

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

          • 2. Re: C++ DLL for FX3 cannot link
            didier.martiny

             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...   
               
                    
               
                    
            • 3. Re: C++ DLL for FX3 cannot link
              martin.maurer

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

              • 4. Re: C++ DLL for FX3 cannot link
                anand.srinivasan.asokan

                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