This is the mail archive of the gcc-help@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]
Other format: [Raw text]

Re: 2.9x to 3.2 static vars problems


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



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