I've tried this, but it won't work. In a file globals.h, I have the following:
int myvar;
Then, in user_routines.c I have:
#include "globals.h"
extern int myvar;
I do the same thing in tracking.c, with the include and extern declaration but I get the following linker error when I try to compile:
symbol 'myvar' has multiple definitions
I access the variable inside the default_routine function, and in another function in the tracking.c file. I've tried declaring it both inside the functions, and at the top of the .c file outside of any function, but below my preprocessor directives. Nothing seems to work. Everything look fine, but what am I doing wrong? Thanks for any ideas you guys might have.
Quote:
|
Originally Posted by Abwehr
|