Barry Jaques

extern not working

Discussion created by Barry Jaques on Sep 26, 2006
Latest reply on Sep 29, 2006 by Barry Jaques
I am rebuilding an app from scratch after losing the source code due to my own stupidity. Thought I saved it on a cd but found that all I saved was a shortcut and since then have had to reinstall Windows.
I am attempting to use global variables and it is just not working.
I create a separate Globals.c file and put the required variables in that file then I intend to use the variables in a function from another file with extern.
The global vars are there OK and the app compiles but after using #include "Globals.c", I get 36 link errors like this:
Link Error : Action.c: Global Object 'speed' was already defined in File: 'Globals.c'. There are 36 vars.
If I comment out #include "Globals.c" I get a couple of hundred "undefined identifier" errors.
This seems a silly error as the object was not already defined in Globals.c but it was 'only' defined in Globals.c.
There is no other reference to Globals.c. One of the many vague and unhelpful errors thrown by Code Warrior.
If someone was able to have a look at the project that would be nice.