I am trying to pass a structure between two files that are compiled independently as part of the same project.
I have two files (file1, file2) as well as an include file. Both file1 and file 2 include the include file.
include.h is the include file, and contains the following:
struct randy_struc {
char *name; //name of option i.e frequency
int value [6]; //value of option
int max_choices; //total number of values for options (20 max)
char *value_string [20]; //string that displays
} ;
In file 1, I have a definition of a member of the structure:
randy_struc
randy_option_1 = //don't change
{" Host interface ",
{3,3,3,3,3,3},
3,
{
"",
"ISA ",
"SMB ",
"None",
},
};
For now assume the structure isnt referenced by file 2, I can then compile my program error free and it works. But now I want access to the structure from file 2 so I add the following to file 2:
extern struct randy_struc; (or several derivatives of the same thing)
I end up with a compiler error message (BC4.2) of "storgae class extern is not allowed here"
Any ideas ?