Answer the question
In order to leave comments, you need to log in
Why doesn't the QueryStringAttribute method work in the tinyxml library element?
I use tinyxml
The code looks something like this:
#include <vector>
#include <string>
#include "tinyxml/tinystr.h" // подключит от безысходности
#include "tinyxml/tinyxml.h"
typedef std::string String;
...
...
TiXmlDocument file( "data/resource.xml" );
if (file.LoadFile())
{
String path;
path = element->Attribute("src");
element->QueryStringAttribute("src",&path); // Ошибка при сборке
element->QueryFloatAttribute("x",&spr_x); // нормально
}
}
Error text: Answer the question
In order to leave comments, you need to log in
In the compiler settings, I added the TINYXML_USE_STL preprocessor,
everything worked.
Instead, the library is built without STL support
tinyxml.h :
#ifdef TIXML_USE_STL
/// QueryStringAttribute examines the attribute - see QueryIntAttribute().
int QueryStringAttribute( const char* name, std::string* _value ) const {
...
#ifdef TIXML_USE_STL
# TINYXML_USE_STL can be used to turn on STL support. NO, then STL
# will not be used. YES will include the STL files.
TINYXML_USE_STL := NO
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question