This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Error #20



Hi, so i am trying to compile a project which contain Bulk USB example, I am currently compiling it in Keil uvision 4. I got no include errors and still I got these errors:

Build Project 'PTX' - Target 'PTX'
compiling usb_dev_bulk.c...
compiling config.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\config.c: 0 warnings, 3 errors
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
C:\Users\Mathieu\Documents\Stage\Code_base_station\CodeBaseStation\PTX\error type>(110): warning:  #177-D: variable "TX" was declared but never referenced
        USBbuffer TX;
C:\Users\Mathieu\Documents\Stage\Code_base_station\CodeBaseStation\PTX\src\main.c(112): warning:  #177-D: variable "CHAR" was declared but never referenced
      unsigned char CHAR = 0x41;
src\main.c: 2 warnings, 3 errors
compiling usb_bulk_structs.c...
compiling nRF.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>..\nRF24L01p_lib\nRF.c: 0 warnings, 3 errors
compiling nRF_config.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>..\nRF24L01p_lib\nRF_config.c: 0 warnings, 3 errors
".\PTX.axf" - 12 Error(s), 2 Warning(s).
Target not created

I have enable the C99 compiling option, but why teh compielr doesnt recognize  tUSBBuffer and tUSBDBulkDevice in usb_bulk_structs.h

  • Mathieu L. said:
    I am currently compiling it in Keil uvision 4

    This forum for questions about compilers released by TI.  That said ...

    Mathieu L. said:
    i am trying to compile a project which contain Bulk USB example

    I don't recognize that example.  But you may have gotten it from TI.  Where did you get it?  I may be able to direct you to the best forum for questions about that example.

    Mathieu L. said:
    why teh compielr doesnt recognize  tUSBBuffer and tUSBDBulkDevice in usb_bulk_structs.h

    My guess is you have the build configured incorrectly.  Maybe you need to have some preprocessor symbol defined before you include that header file.

    Thanks and regards,

    -George

  • Hi, i am refering to usb_dev_bulk example from Trivaware and Stellarisware package. I posted on Keil forums, but I didnt get any answers yet.
  • Mathieu L. said:
    I posted on Keil forums, but I didnt get any answers yet

    You have now: 

    As noted there, when the compiler tells you that something is un-defined then the obvious solution is to define it - isn't it?

    And, most likely, the easiest way to define it is to #include the header file which contains a ready-made definition...

    (Not that this applies to any compiler - it's not specific to Keil, TI, or whatever else)

  • Hi,
    that is the correct solution, i did it earlier today and it resolve all the problems.
    Regards.

    Mathieu