This is indeed the appropriate solution. You can even leave the enum name ("Constants") out. Also no need to put anything special for this in the LinkDef.h pragma's as cint will generate the correct interface for the embedded enum. -- Fons On Tue, 2002-01-29 at 13:43, mathes@ik.fzk.de wrote: > > Hi Christian, > > thanks for the reply. Your suggestion was not what I indended to do but it > helped me anyway ... > > I wanted to have a constant in the 'namespace' of the class TEyeEventHeader > and use it outside of this class as TEyeEventHeader::kTicksPerSecond. > That is the reason why it was not named fgTicksPerSecond. > > Well an appropriate solution could be: > > class TEyeEventHeader : public TObject { > public: > enum Constants { > kTicksPerSecond = 100000000 > }; > > ClassDef(TEyeEventHeader,(int)EyeEVENTVERSIONv1) > }; > > or what do you think ? > > Probably declaration and definition of the member variable is something > which is not generally allowed ? > > Hermann-Josef > > On Tue, 29 Jan 2002, Christian Holm Christensen wrote: > > > Hi Hermann-Josef, > > > > On Tue, 29 Jan 2002 10:27:16 +0100 (CET) > > "mathes@ik.fzk.de" <mathes@ik3.fzk.de> wrote > > concerning "[ROOT] Unresolved reference and CINT": > > > Dear Rooters, > > > > > > I have a question concerning the right format of the LinkDef.h file. > > > My class contains: > > > class TEyeEventHeader : public TObject { > > > public: > > > static const UInt_t kTicksPerSecond = 100000000; > > > // ... more stuff > > > ClassDef(TEyeEventHeader,(int)EyeEVENTVERSIONv1) > > > }; > > > > > > > Put the definition of > > > > TEyeEventHeader::kTicksPerSecond > > > > (you mean TEyeEventHeader::fgTicksPerSecond don't ya?) in a > > implmentation file (aka source file - one that's compiled). See also > > [1]. It refers to GCC 3, but it also applies to GCC 2.95.2. You may > > have the documentation as an info doc. Try > > > > info gcc Trouble C++ Static > > > > Yours, > > > > Christian Holm Christensen ------------------------------------------- > > Address: Sankt Hansgade 23, 1. th. Phone: (+45) 35 35 96 91 > > DK-2200 Copenhagen N Cell: (+45) 28 82 16 23 > > Denmark Office: (+45) 353 25 305 > > Email: cholm@nbi.dk Web: www.nbi.dk/~cholm > > > > > > > > [1] http://gcc.gnu.org/onlinedocs/gcc-3.0.3/gcc_9.html#SEC148 > > -- Org: CERN, European Laboratory for Particle Physics. Mail: 1211 Geneve 23, Switzerland E-Mail: Fons.Rademakers@cern.ch Phone: +41 22 7679248 WWW: http://root.cern.ch/~rdm/ Fax: +41 22 7679480
This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:40 MET