MarkW wrote:
This may be a C question rather than a CW problem (I'm kinda new to both),
but here goes. I have one header file, MyApp.h, a C source file called
MyApp.c, and one called Main.c to handle main form events. I #include the
header file in both C files. When I MAKE the project, I get error messages
stating the global variables in the header file are already defined in the
MyApp.c file. What have I done wrong?

Declare your globals in the header using the extern keyword.

extern int MyInt;



Define your globals once in one .c file.

int MyInt;

--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to