<rosethorn@gmail.com> wrote in message
news:1110565254.573315.87990@o13g2000cwo.googlegro ups.com...[color=blue]
> 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.[/color]
If the library is statically linked, your latter approach
should have worked and its failure to do so will have
to be diagnosed with the benefit of seeing some code.
If the library is dynamically linked, your problem is
off-topic here and should be taken to one of the
groups in the microsoft.public.* hierarchy.
--
--Larry Brasfield
email:
donotspam_larry_brasfield@hotmail.com
Above views may belong only to me.