Link to home
Start Free TrialLog in
Avatar of vivekpara
vivekparaFlag for United States of America

asked on

Ambiguous overload for 'wxString& = TiXmlElement*&' operator

I am using the wxWidgets library (formally wxWindows) and the TinyXML library.  I want to parse a value from the XML document which will serve as my User Interface structure and update the button values for the elements of the sibling nodes

The variables for the button labels are lbutton1, lbutton2, lbutton3, lbutton4, etc.

I have used the following code to parse the XML document (hopefully) correctly:

node = doc.FirstChild( "UID" );
assert( node );
uidElement = node->ToElement();
assert( uidElement );
button1 = node->ToElement();
assert ( button1 );

When I add the following line

lbutton1 = button1;


, the code will not compile and I receive the following errors:

ambiguous overload for 'wxString& = TiXmlElement*&; operator
candidates are: wxString&
             wxString&
             wxString&
             wxString&
[Build Error] [UI.o] Error 1

I am using Bloodshed Dev-C++.  It seems to be some sort of circular reference I've created...I think...
Avatar of jkr
jkr
Flag of Germany image

How are 'lbutton1' and 'button1' declared?
BTW, did you mean to

lbutton1 = button1->Attribute("AttributeName");
Avatar of vivekpara

ASKER

lbutton1 is declared by:

wxString ( lbutton1 );

button1 is declared
TiXmlElement* button1 = 0;

Don't know if thats what I meant...but it seems to make sense.  I'll try it.
SOLUTION
Avatar of Jaime Olivares
Jaime Olivares
Flag of Peru image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I will have to claim stupidity as my defense.  =)

I was cutting and pasting code and didn't notice that was a pointer.  Good call, y'all.

"You're right, you're right, I know you're right."
                            - Carrie Fisher
                            - "When Harry Met Sally"