Hi Christian,
Christian Holm Christensen writes:
> I don't know if this has anything to do with it, but I reported
>
> http://root.cern.ch/root/roottalk/roottalk01/1561.html
My problems seem to be more related to the use of pair<> than nexted
classes. Here is my example simplified with the nested class removed:
-------------------------------
#ifndef PAIRCLASS_H
#define PAIRCLASS_H
#include "TBox.h"
#include <list>
#include <map>
class SomeClass;
class PairClass : public TObject
{
public:
PairClass();
virtual ~PairClass();
private:
map<int,pair<int, const SomeClass*> > fPairListMap;
list<pair<int,const SomeClass*> > fPairList;
};
#endif // PAIRCLASS_H
-------------------------------
Running rootcint on this I get:
-------------------------------
bviren@minos:test> rootcint -f PairClassCint.cc -c PairClass.h PairClassLinkdef.h
Error: Symbol constSomeClass is not defined in current scope FILE:prec_stl/utility LINE:12
Error: Symbol second is not defined in current scope FILE:prec_stl/utility LINE:12
Warning: Unknown type 'constSomeClass' in function argument handled as int FILE:prec_stl/utility LINE:14
Error: Symbol pair<int is not defined in current scope FILE:prec_stl/list LINE:143
Error: Symbol constSomeClass is not defined in current scope FILE:prec_stl/list LINE:143
Error: G__getvariable: expression FILE:prec_stl/list LINE:143
Warning: Error occured during reading source files
Warning: Error occured during dictionary source generation
!!!Removing PairClassCint.cc PairClassCint.h !!!
rootcint: error loading headers...
-------------------------------
However, if I remove the "const" from "SomeClass*" and use a "const
int" for the the "first" member of the pair, it succeeds. Looking at
SGI's STL reference shows that the "first" member needs to be const;
okay, fine. But I still need to have "const SomeClass*".
> > Compiling PairClass.{h,cxx} with g++ 2.95.4 (Debian GNU/Linux x86)
>
> You really like to live dangerous don't you? I guess you're running
> unstable, right? Brave you. BTW, how does it compare to potato?
Not so dangerously. I am mostly running potato + testing + a little
bit of unstable. Anyways, as you know, the names for Debian's
distributions are all a bit of misnomers. If allowed, I would rename
the Debian's dists like:
"stable" --> "rock-solid-but-oh-so-out-of-date"
"testing" --> "stable"
"unstable" --> "once-in-a-blue-moon-you'll-see-a-problem"
As for this gcc "2.95.4" version, it is really 2.95.3+patches. Debian
isn't pulling a RedHat 2.96 snafu here as far as I can tell.
-Brett.
This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:58 MET