This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: none
- To: Patrick Barron <barron at adulis dot fr>
- Subject: Re: none
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 19 Nov 1998 11:46:58 -0200
- Cc: egcs-bugs at cygnus dot com
- References: <3654036D.9A5FC667@adulis.fr>
On Nov 19, 1998, Patrick Barron <barron@adulis.fr> wrote:
> file2-a.o(.bss+0x4): multiple definition of `i1'
> file1-a.o(.bss+0x4): first defined here
> I read that the problem comes frome the static variable.
Nope, the problem is the duplicate definition of a global variable.
If they're not supposed to be the same variable, name them differently,
make them both static or declare them within an anonymous namespace.
If they are, just declare the variable as extern in one of the
translation units, and define it in the other.
--
Alexandre Oliva http://www.dcc.unicamp.br/~oliva aoliva@{acm.org}
oliva@{dcc.unicamp.br,gnu.org,egcs.cygnus.com,samba.org.au}
Universidade Estadual de Campinas, SP, Brasil