This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

error C129 : missing ";" before xdata

I'm converting some C code from Archimedies to Keil version 7.0 and I don't know why this error C129 is popping up. I thought is was because in Archimedies xdata came before uchar so I switched around all xdata variables in the Global.c and Global.h files but still had the error. So I inserted a new #define line above the error point but still have the error. Here is how the codes is written and the error message points to the BOLD text line:
Global.c file
#include "header.h"
#include "global.h"

/* The following are BIT status errors */

uchar xdata arincReceive0Counter;
uchar xdata arincReceive1Counter;
uchar xdata CurrentlyUsedARINC;

Global.h file
#define ARINC_CHAN0_CHK_BSY ARINC_CHAN0 + ARINC_CHK_BSY
#define ARINC_CHAN0_USED ARINC_CHAN0 + ARINC_USED
#define ARINC_CHAN1_CHK_BSY ARINC_CHAN1 + ARINC_CHK_BSY
#define ARINC_CHAN1_USED ARINC_CHAN1 + ARINC_USED

extern uchar xdata arincReceive0Counter;
extern uchar xdata arincReceive1Counter;
extern uchar xdata CurrentlyUsedARINC;

Got any ideals?

Parents
  • When I insert the #include "header.h" into the global.h file Error C231 Redifinition occurs for all of the reg420.h #defines. This is because #include "c:\keil\c51\inc\dallas\reg420.h" is in the header.h file. I tried adding this reg420.h file to the Target Group but that didn't work.

    I did just add the following to the global.h file
    #define uint unsigned int
    #define uchar unsigned char
    #define ulong unsigned long int
    that got rid of the Error C129's but now I get Error C202 undefined indentifier all of the identifiers that are #define in header.h.

    I think the problem is the way this code is written with all of these .h files. Would this be correct?

Reply
  • When I insert the #include "header.h" into the global.h file Error C231 Redifinition occurs for all of the reg420.h #defines. This is because #include "c:\keil\c51\inc\dallas\reg420.h" is in the header.h file. I tried adding this reg420.h file to the Target Group but that didn't work.

    I did just add the following to the global.h file
    #define uint unsigned int
    #define uchar unsigned char
    #define ulong unsigned long int
    that got rid of the Error C129's but now I get Error C202 undefined indentifier all of the identifiers that are #define in header.h.

    I think the problem is the way this code is written with all of these .h files. Would this be correct?

Children