tags:

views:

58

answers:

2

I'm programming in C. I'm getting the following error:

ctc E208: ["..\..\ECB\Include\ecb.h" 4/11] syntax error - token ";"
inserted before "u8_vTeethBeforeMissingTeeth1"

Here is what I have in the .h file:

#ifndef __ECB_H__
#define __ECB_H__

extern u8 u8_vTeethBeforeMissingTeeth1;
extern u8 u8_vTeethBeforeMissingTeeth2;

#endif /* __ECB_H__ */

Can anyone please tell me what am I missing in this section of code?

+2  A: 

The trouble is that your header is not self-contained. It relies on a type 'u8' which is not defined here (and not defined in any of the other headers you've included before this). You should include the header that defines 'u8' in your 'ecb.h' header before declaring your 'missing teeth' variables.

Headers should be self-contained; if you need the services of the header, you should be able to include it without worrying about what else needs to be included. The standard C headers do that for you - you should do it for yourself with your own headers.

Jonathan Leffler
This is almost certainly the correct answer.
Swiss
A: 

This is my guess. You have #define u8 and that definition is wrong. It contains extra ; somewhere.

Manoj R
No; the compiler inserted the semi-colon as an attempt at error recovery.
Jonathan Leffler
Thanks a lot for the answers. The problem seemed to be with the declaration of u8. So I included the file that has a definition for u8, and its working correctly now.
Angelo
Thanks a million.
Angelo