hi all,
I'm using GCC 4.8.1 and I want to implement a XML parser using TinyXML and port it to AngelScript
now, it says:
reference to 'Column' is ambiguous
I've declared a class called xml_parser and I've added everything of tinyxml as it's public member
when I call Column(), and also Row(), it give's this error
what should I do?
this is it's code:
xml_parser.hpp:
Nowhere in your code have you shown us the declarations or definitions for entities named "Row" or "Column", so there's no way we can identify any ambiguities.
Column and Row are in the TiXmlBase class
but another thing that I've noticed is, boath of them are public members
now a problem occurred is that error!
where is this problem?
Are you sure one or more of your other base classes doesn't also contain methods with those names.
You're inheriting from nine different base classes! That can't possibly be right. Why do you think you need to inherit from so many? That's bound to cause you problems, and I'm sure you must have misunderstood something.
My guess would be that some of those other 8 classes you're inheriting also inherit from TiXmlBase. That's where the ambiguity is occurring.
You've completely ignored the questions I asked in my last post. I'll reiterate: Nine is an insane number of classes to inherit from. In nearly 20 years of C++ programming, I've never seen anyone try to write a class that directly inherits from that many classes. Are you absolutely certain you haven't misunderstood something?
If you're dead set on doing something as crazy as this, then you need to go and read up on the difficulties of multiple inheritance, and in particular, look at virtual inheritance.
boath Column() and Row() functions are declared inside TiXmlBase class and boath are public
Now you're just repeating yourself. Are you actually bothering to read the posts other people are making? JLBorges and I have both explained where the problem is - it's that several of the classes you're inheriting from also inherit from TiXmlBase, so there are multiple "instances" of those methods.
I've never used tinyxml, so I don't know. That's why I was asking you those questions, which you didn't bother to answer. If you refuse to tell me the things I'm trying to find out, then there's no way I can help you.
Don't worry, I'm not taking it personally. You didn't bother to answer JLBorges either, when he asked you similar questions.
But why do you think your class needs to inherit from all of them?
Do you know what inheritance means?
Do you understand what type of relationship inheritance is intended to model?
I'd recommend you do some more reading and learning about inheritance. It can be tricky to understand, and a good textbook or tutorial should help you out a lot.
i know what is inheritance
i didn't know that all the classes use TiXmlBase as there inheritance members
i read the documentations very bad and very carelessly!
this is because of lag of my eyesight
thanks a lot,
now,
what is your idea about expat?
expat is better or tinyxml?
Expat is a stream-oriented XML parser written in C. It had a declining user base because there were no new releases for about five years or so, till 2012.
TinyXML has limited functionality and poor performance, but it is by far the easiest XML parser to use.