Strange Compile Error | Cypress Semiconductor
Strange Compile Error
I am attempting to connect with a USB device using the CyUSB.dll libraries using Visual Studio. I was using the template here: http://www.cypress.com/?docID=28357. I haven't gotten too far. So far this is what I have.
USBDeviceList usbDevices = gcnew USBDeviceList(CyConst::DEVICES_CYUSB);
Which is adapted from:
usbDevices = new USBDeviceList(CyConst.DEVICES_CYUSB);
Used in the above mentioned template. I am doing this in Visual C and the template is in C#; so I am assuming that my issues are arising form this. Here is my compiler error:
1>Driver.cpp(9): error C2664: 'CyUSB::USBDeviceList::USBDeviceList(unsigned char)' : cannot convert parameter 1 from 'CyUSB::USBDeviceList ^' to 'unsigned char'
1> No user-defined-conversion operator available, or
1> There is no context in which this conversion is possible
I don't understand why this is causing an issue for me? This line compiles fine:
unsigned char option = CyConst::DEVICES_CYUSB;
It even prints a value for option if I print it. However passing option to the UsbDeviceList constructor throws the same error. I am somewhat new to Microsoft development, so any advice would be nice.