This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: none


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]