Hi, I have strucr define in a lib file from TI. Here the message error from Keil uvision 4, I got no error in my include:
Build Project 'PTX' - Target 'PTX' compiling main.c... C:\Users\Mathieu\Documents\Stage\Code_base_station\CodeBaseStation\PTX\src\usb_bulk_structs.h(42): error: #20: identifier "tUSBBuffer" is undefined extern const tUSBBuffer g_sTxBuffer; KB: Unexpected type: 0 C:\Users\Mathieu\Documents\Stage\Code_base_station\CodeBaseStation\PTX\error type>(43): error: #20: identifier "tUSBBuffer" is undefined extern const tUSBBuffer g_sRxBuffer; KB: Unexpected type: 0 C:\Users\Mathieu\Documents\Stage\Code_base_station\CodeBaseStation\PTX\error type>(44): error: #20: identifier "tUSBDBulkDevice" is undefined extern const tUSBDBulkDevice g_sBulkDevice; KB: Unexpected type: 0 <error type>src\main.c: 0 warnings, 3 errors ".\PTX.axf" - 3 Error(s), 0 Warning(s). Target not created
Anyone know how to fix this?
the compiler scratches its head and wonders "const WHAT"
Erik
extern constant looks like the constants are defined in a different file and is not included in your project.
When is tells you that something is un-defined, the obvious fix is to define it - surely??
usb_bulk_structs.h(42): error: #20: identifier "tUSBBuffer" is undefined extern const tUSBBuffer g_sTxBuffer;
As others have noted, it probably means that you've omitted to #include the header containing the definition...
The solution to my problem was to include the librairy reference include:
#include "usblib/usblib.h" #include "usblib/usb-ids.h" #include "usblib/device/usbdevice.h" #include "usblib/device/usbdbulk.h"