Typedef enum not seen by all .c files? How to creat macro

Thread Starter

danielb33

Joined Aug 20, 2012
105
I often need to use a var.h file for some global variables for interrupt driven code. I am just starting to write large enough programs to where typedef enums, structures and unions will help the code be much more readable.

When I place a typedef enum in my header files, I get multiple definitions errors when including that header in multiple .c files. Is there an extern reference of sort for typedef? Or does anyone know how to make the typedef be seen by all or multiple files?

Thanks much.
 

WBahn

Joined Mar 31, 2012
30,058
Glad you found it. For future reference, it really helps if you post the code snippet that is causing the problem. If you hadn't found your mistake, then someone here probably would have spotted it right away, whereas from just a verbal description it would have been very hard to guess that that was the problem.
 
Top