8 Replies Latest reply on Apr 20, 2016 11:51 PM by user_246598725

    syntax error near 'int': why?

    user_13524663

      Alright, this is going to make me look really stupid, but I have searched for this error message and got zero results. I like to add an obvious indication to my code so that I know that the code loaded and at least this simple function is working, if not the others. For the following code:

         

      #include <project.h>

         

      int main()
      {
          CyGlobalIntEnable; /* Enable global interrupts. */
          uint8 LED_On = 0;

         

              /* Place your initialization/startup code here (e.g. MyInst_Start()) */

         

          for(;;)
          {
              /* Place your application code here. */
              LED_Write(LED_On);
              CyDelay(500);
              LED_On = !LED_On;

         

          }
      }

         

      I get the following errors:

         

      Build error: syntax error near 'uint8' (I assume that "uint8" is a valid type)

         

      Build error: 'LED_On': undefined identifier (one per line that LED_On appears in).

         

      I can't figure out how something so basic is a problem except that I need to include another library and I find nothing that tells me what to include. What resource tells me how to write C for Creator?