简体   繁体   English

编译程序时出现“ No Definition”错误

[英]“No Definition” error while compiling the program

I have compiled a USB program for STM32F0. 我已经为STM32F0编译了USB程序。 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] 

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. 好吧,看来您只是从某个地方复制粘贴了该调用,并且也未能复制它引用的USBD_CustomHID_fops声明。 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. 您应该在其中填写回调指针的地方。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM