This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: 2.9x to 3.2 static vars problems
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: albert at wickywicky dot net
- Cc: gcc-help at gcc dot gnu dot org
- Date: Sun, 01 Jun 2003 15:36:55 +0100
- Subject: Re: 2.9x to 3.2 static vars problems
- Organization: Codesourcery LLC
- References: <34543.80.58.50.42.1054476033.squirrel@www.wickywicky.net>
albert@wickywicky.net wrote:
I'm trying to compile with g++ 3.2 an application that compiles without
problems with 2.9x. The problem is with static varibles of classes. I've
got them defined outside the class:
int Semaphore::key;
and inside the class:
static int key;
but I get the following error:
order.o(.bss+0x0): multiple definition of `Semaphore::key'
main.o(.bss+0x0): first defined here
Any ideas of what I'm doing wrong?
you have multiple definitions of Semaphore::key. I'm guessing you have the
out-of-class definition in a header file.
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
The voices in my head said this was stupid too
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk