From: Tim R. <ti...@pr...> - 2011-01-25 01:47:14
|
He.David wrote: > > Hi, Does anyone can help me to figure out why I got this compiler > error? How to pass the call back function in this case? > > > > voidtransfer_cb_fn (libusb_transfer* transfer){ > > cout<<"call back function called"<<endl; > > } > > > > Void main(…){ > > … > > libusb_transfer* transfer; > > libusb_fill_interrupt_transfer (transfer, dev_handle, 129, data, 20, > transfer_cb_fn, user_data, 10000); > > > > } > > > > Error message: > > error C2664: 'libusb_fill_interrupt_transfer' : cannot convert > parameter 6 from 'void (__cdecl *)(libusb_transfer *)' to > 'libusb_transfer_cb_fn' > > 2> None of the functions with this name in scope match the > target type > Try declaring it as C linkage: extern "C" void cb_fn( libusb_transfer* transfer ); -- Tim Roberts, ti...@pr... Providenza & Boekelheide, Inc. |