g++ 4.4 compile error

Hi there. I´ve been trying to compile a third party software in Ubuntu (9.10) using g++-4.4. The code worked fine in older versions of Ubuntu (which used older g++). The error I get is:


>> Compiling tmp/src/ExRootAnalysisDict.cc
tmp/src/ExRootAnalysisDict.cc:177: error: wrong number of template arguments (1, should be 2)
/usr/include/c++/4.4/bits/stl_pair.h:67: error: provided for ‘template<class _T1, class _T2> struct std::pair’
tmp/src/ExRootAnalysisDict.cc:177: error: wrong number of template arguments (1, should be 2)
/usr/include/c++/4.4/bits/stl_pair.h:67: error: provided for ‘template<class _T1, class _T2> struct std::pair’
tmp/src/ExRootAnalysisDict.cc:177: error: template argument 2 is invalid
tmp/src/ExRootAnalysisDict.cc:177: error: template argument 1 is invalid
tmp/src/ExRootAnalysisDict.cc:177: error: template argument 2 is invalid
tmp/src/ExRootAnalysisDict.cc:177: error: template argument 4 is invalid


The particular piece of code that seems to be generating that is (from lines 161 to 182, the long one is line 177 mentioned in the error)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#if !(defined(R__ACCESS_IN_SYMBOL) || defined(R__USE_SHADOW_CLASS))
      typedef ::ExRootFilter ExRootFilter;
      #else
      class ExRootFilter  {
         public:
         //friend XX;
         #if !(defined(R__ACCESS_IN_SYMBOL) || defined(R__USE_SHADOW_CLASS))
         typedef ::ExRootFilter::FilterExeption FilterExeption;
         #else
         class FilterExeption  {
            public:
            //friend XX;
         };
         #endif

         typedef ::std::map<int, ::TObjArray*, ::less<int>, ::allocator< ::pair<const int, ::TObjArray*> > > TCategoryMap;
         typedef ::std::map< ::ExRootClassifier*, ::pair< ::bool, ::map<int, ::TObjArray*, ::less<int>, ::allocator< ::pair<const int, ::TObjArray*> > > >, ::less< ::ExRootClassifier*>, ::allocator< ::pair< ::ExRootClassifier* const, ::pair< ::bool, ::map<int, ::TObjArray*, ::less<int>, ::allocator< ::pair<const int, ::TObjArray*> > > > > > > TClassifierMap;
         :: TSeqCollection* fCollection; //
         ::TIterator* fIter; //
         TClassifierMap fMap; //
      };
      #endif 


Anyone has an idea of what´s going on?

I´m a novice in c++, and I´m guessing there´s some change in parsing from older g++ to the current. If there´s an easy chage I could do to the code to make it run it would be great.

Thanks
My compiler didn't like the ::bool from the long line, so I removed the :: and now it seems to work.

So maybe try this:
 
typedef ::std::map< ::ExRootClassifier*, ::pair< bool, ::map<int, ::TObjArray*, ::less<int>, ::allocator< ::pair<const int, ::TObjArray*> > > >, ::less< ::ExRootClassifier*>, ::allocator< ::pair< ::ExRootClassifier* const, ::pair< ::bool, ::map<int, ::TObjArray*, ::less<int>, ::allocator< ::pair<const int, ::TObjArray*> > > > > > > TClassifierMap;
Hi Galik

I did work, I mean, it compiles with some warnings but those are related to other pieces of the code. Now I´ll do some extra testing to see if everything is working.

Thanks for your help
Topic archived. No new replies allowed.