istiaq2379
istiaq2379

Reputation: 113

"No Definition" error while compiling the program

I have compiled a USB program for STM32F0. I called a function to register the interface:

USBD_CUSTOM_HID_RegisterInterface(&hUsbDeviceFS, &USBD_CustomHID_fops).

But I am getting the error below. I can't find out the problem, because it doesn't point at any particular line:

Error[Li005]: no definition for "USBD_CustomHID_fops" [referenced from C:\Users\Istma1\Downloads\stm32cubef0\STM32Cube_FW_F0_V1.0.0\USB7\USB5\USB5\Projects\EWARM\USB3 Configuration\Obj\main.o] 

Upvotes: 0

Views: 3623

Answers (1)

unwind
unwind

Reputation: 399871

Well, it looks like you just copy-pasted that call from somewhere, and failed to also copy the USBD_CustomHID_fops declaration that it references. It might refer to a structure declared like this:

typedef struct _USBD_CUSTOM_HID_Itf
{
uint8_t *pReport;
int8_t (* Init) (void);
int8_t (* DeInit) (void);
int8_t (* OutEvent) (uint8_t, uint8_t );
}USBD_CUSTOM_HID_ItfTypeDef;

where you are supposed to fill in your callback pointers.

Upvotes: 1

Related Questions