?
Solved

Compiler Error C2825: cannot form a qualified name, NEEDS EXPLAINING

Posted on 2003-03-25
24
Medium Priority
?
589 Views
Last Modified: 2007-12-19
I get this error:

c:\work\orc\all_orc_projects\STLport-4.5.3\stlport\stl\_iterator_base.h(82) : error C2825: '_Iterator::iterator_category': cannot form a qualified name
        c:\work\orc\all_orc_projects\osprey1.0\be\opt\opt_cfg_trans.h(100) : see reference to class template instantiation '_STL::iterator_traits<_Iterator>' being compiled
        with
        [
            _Iterator=cluster_vector<edge,_STL::select1st<edge>>::fast_iterator
        ]
        c:\work\orc\all_orc_projects\osprey1.0\be\opt\opt_cfg_trans.cxx(198) : see reference to class template instantiation 'composite_iterator<Cluster_iterator,Fast_iterator>' being compiled
        with
        [
            Cluster_iterator=cluster_vector<edge,_STL::select1st<edge>>::cluster_iterator,
            Fast_iterator=cluster_vector<edge,_STL::select1st<edge>>::fast_iterator
        ]
--------------------------------------------------------------
The source lines pointed to are:

_iterator_base.h(82):
template <class _Iterator>
struct iterator_traits {
  typedef typename _Iterator::iterator_category iterator_category;
...
};


opt_cfg_trans.h(100):
template <class Cluster_iterator, class Fast_iterator>
class composite_iterator {
public:
...
  typedef typename iterator_traits<Fast_iterator>::value_type      value_type;
...
}

opt_cfg_trans.cxx(198):  (IT ALL STARTS HERE !!!)
for (successor_graph::iterator e = g.begin(); e != g.end(); ++e)
{ ... }

where :
typedef cluster_vector<edge, select1st<edge> > successor_graph;

This is cluster vector:
template <class T, class IndexFunction>
class cluster_vector {
public:
  typedef typename IndexFunction::result_type cluster_id;
  typedef T value_type;
  typedef IndexFunction index_function;
  typedef cluster_vector<T, IndexFunction> self;
  typedef vector<value_type> cluster_type;
  typedef cluster_type::iterator      fast_iterator;
  typedef cluster_type::size_type     size_type;
  typedef vector<cluster_type>        cluster_container;
  typedef cluster_container::iterator cluster_iterator;
  typedef composite_iterator<cluster_iterator, fast_iterator> iterator;
...
}

and this is composite_iterator:

template <class Cluster_iterator, class Fast_iterator>
class composite_iterator {
public:
  typedef composite_iterator<Cluster_iterator, Fast_iterator> self;
  typedef forward_iterator_tag iterator_category;
  typedef typename iterator_traits<Fast_iterator>::value_type      value_type;
  typedef typename iterator_traits<Fast_iterator>::difference_type
          difference_type;
  typedef typename iterator_traits<Fast_iterator>::pointer         pointer;
  typedef typename iterator_traits<Fast_iterator>::reference       reference;
...
}

--------------------------------------------------------------
What do I miss ???
0
Comment
Question by:eladho
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 12
  • 9
  • 2
  • +1
24 Comments
 
LVL 8

Expert Comment

by:Zlatin Zlatev
ID: 8203160
0
 

Author Comment

by:eladho
ID: 8204062
Well, I read this a million times, but I just don't understand what this error is all about.
Can you/anyone please explain that in simple english?
Even better- how does that error relate to my code?
0
 
LVL 8

Expert Comment

by:Zlatin Zlatev
ID: 8208679
What about changing
_iterator_base.h(82):
template <class _Iterator>
struct iterator_traits {
 typedef typename _Iterator::iterator_category iterator_category;
...
};

with
_iterator_base.h(82):
template <class _Iterator>
struct iterator_traits {
 typedef typename _Iterator::~iterator_category iterator_category;
...
};

0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 

Author Comment

by:eladho
ID: 8208862
I thought so myself, but it doesn't help:

c:\work\orc\all_orc_projects\STLport-4.5.3\stlport\stl\_iterator_base.h(82) : error C2523: '<Unknown>::~iterator_category' : destructor tag mismatch

My biggest problem is that I just don't understand what the original error is all about, and therefore- I cannot tackle it...
0
 
LVL 8

Expert Comment

by:Zlatin Zlatev
ID: 8208944
@eladho, I cannot check your code via CS compiler, but according to me (as I have read your question carefully)
Your problem seems to be with this "_Iterator" before the "::" in line
 typedef typename _Iterator::iterator_category iterator_category;

What do you want to achieve?
0
 
LVL 8

Expert Comment

by:Zlatin Zlatev
ID: 8208991
Check whether this article about templates will be of any value for you:
http://jamesthornton.com/eckel/TICPP-2nd-ed-Vol-two/Chapter03.html
0
 
LVL 8

Expert Comment

by:Zlatin Zlatev
ID: 8209018
Well what about changing the type name, e.g.:

typedef typename _Iterator::iterator_category cls_iterator_category; //cls_ is added to make difference



0
 

Author Comment

by:eladho
ID: 8210906
Sorry for stalling with the answer. Well- changing the name doesn't help, though I have a strong feeling something as easy as that should solve the problem.
What is the nature of the error in Microsoft's example:

// C2825.cpp
typedef int i;
int main() {
   int* p = new int;
   p->i::i();   // C2825
   // try the following line instead
   // p->i::~i();
}

What seems to cause an error in the line p->i::i();  ?
I think getting to the bottom of it will help me a lot to figure the problem in my case.

Elad.


0
 
LVL 8

Expert Comment

by:Zlatin Zlatev
ID: 8306052
@eladho, What about posting this in C# TA?
0
 

Author Comment

by:eladho
ID: 8306102
Zlatev, thanx very much for your help.
It appears that I had a problem with the way <vector> was defined (I use 'stlport' as a portable stl library) and apparently, the only way my code compiled is under their debug mode (defining _STLP_DEBUG in case you ever wanna use it).
So, a big mess over stupid stuff. Thanx for the willingness to help !!!!!
0
 
LVL 8

Expert Comment

by:Zlatin Zlatev
ID: 8306107
So I suppose you have solved this yourself?
0
 

Author Comment

by:eladho
ID: 8306120
Yes :-)
0
 
LVL 8

Expert Comment

by:Zlatin Zlatev
ID: 8306156
0
 

Author Comment

by:eladho
ID: 8306248
What does that mean?
If you want the points, just say so and they are yours as you most certainly deserve them for devotion.
0
 
LVL 8

Expert Comment

by:Zlatin Zlatev
ID: 8306270
No, no, no - I have asked that you will be refunded your points - just because you have posted your solution.

If you wish to assign me some of them, you can leave comment for the moderators, for example to reduce the points, and to assign me the rest.
0
 

Author Comment

by:eladho
ID: 8306495
Ahhh, thanx :-)
How and where do I leave a comment for the moderators?
0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
ID: 8311776
User resolved; points refunded and question closed.

eladho,

Please see http://www.cityofangels.com/Experts/Member.htm and http://www.cityofangels.com/Experts/Closing.htm

Netminder
EE Admin
0
 
LVL 8

Expert Comment

by:Zlatin Zlatev
ID: 8312089
Eladho, if you like my comments and want to give me some points, you can post "points for" question like it is described in http://www.cityofangels.com/Experts/Closing.htm#3

Note that I do not want or push you to do so - it is your decision.

Kind Regards,
Zlatin Zlatev
0
 
LVL 8

Expert Comment

by:Zlatin Zlatev
ID: 8312096
NetMinder, what about creating a FAQ page that is available through link under the EE member name, that will contain the links you have posted above?
0
 
LVL 5

Expert Comment

by:Netminder
ID: 8312201
zlatev,

My understanding is that after the Engineering boys have finished the rewrite, they'll do something like that. In the meantime, because we have so many new members, and because many of the links in the various EE pages are no longer valid, we've used some space donated by a friend of mine to at least try and give people SOME direction.

Netminder
0
 
LVL 8

Expert Comment

by:Zlatin Zlatev
ID: 8312287
OK, I see.
0
 

Author Comment

by:eladho
ID: 8321222
Thanx all.
"points for" question added:
http://www.experts-exchange.com/Community_Support/Q_20583527.html

eladho.
0
 

Expert Comment

by:modulo
ID: 8321875
Dear eladho,

You can post a "Points for zlatev" Q in this topic area.

Please:
1) Post the link to the original Q in the "Points for zlatev" and
2) Add in the original Q a comment with the link to the "Points for zlatev", thus the email notif will warn zlatev.

modulo

Community Support Moderator
Experts Exchange
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question