[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [rtl] RTLinux: C++ static members != good ?



On Fri, May 25, 2001 at 08:56:15AM -0400, Heinz Haeberle wrote:
> What you have to add this to _one_ of the .cpp files:
> int A::a;
> or
> int A::a=0;
> if you want to initialize it

This is exactly one of the thing which just don't work at our place. I mean
the compiler doesn't cry or something, but the value is just not there. The
definition/declaration is a bit more complex, but you just reach nothing
over the pointer:

in .h file:

typdef tDescription  char*;

class tTest {

static const tDescription[] desc;
}

in .C file:

tDecription tTest::desc[] = { "one", two" }; 


in Linux space this works quite well.

blue skies
	Jan
-- 
-- Jan Christian Albiez --    
-- FZI -- Haid-und-Neu-Str. 10-14 -- 76131 Karlsruhe -- +49 721 9654 206 --
-- segmentation violation in module reality.o ...
                            ... please shutdown your universe and reboot --