R
rosethorn
I'm modifying a pre-existing programme with a defined project
structure. I need to add a global variable that is visible in both an
implementation file in a library, and visible inside the main of a
programme that uses that library. This seems to be impossible, as any
approach I take either results in the variable being invisible in one
file, or the linker complaining about multiple definition. I'm using MS
VC++ 6.
The two basic approaches I've taken have been to either define the
variable in a header file, which results in multiple definition
complaints, or to try using extern declarations, which results in mere
invisibility.
Please help.
structure. I need to add a global variable that is visible in both an
implementation file in a library, and visible inside the main of a
programme that uses that library. This seems to be impossible, as any
approach I take either results in the variable being invisible in one
file, or the linker complaining about multiple definition. I'm using MS
VC++ 6.
The two basic approaches I've taken have been to either define the
variable in a header file, which results in multiple definition
complaints, or to try using extern declarations, which results in mere
invisibility.
Please help.