im trying to compile a c++program in unix enviroment at HPUX box via c++ Compiler, but im hit with below error.
Im not sure where it goes wrong as using the same file we are able to compile in Sun Solaris Enviroment
Error:
[89] % gmake -f xml.mk
g++ -g -D__USE_STD_IOSTREAM -DBSD -DOSFDEC10 -DAXPOSF -DAXP30 -ansi -I/usr/local/include -I/usr/local/lib/gcc/ia64-hp-hpux11.31/4.2.3/include -I/usr/local/include/g++-3 -I/export2/home/oracle/client/product/11.2.0/rdbms/demo -I/export2/home/oracle/client/product/11.2.0/rdbms/public -I/export2/mes/FASTech/SDT/include -I./ -I../../../../export/cxx/include -c action_store.cpp -o action_store.o
In file included from action_store.h:33,
from action_store.cpp:30:
tinyxml.h: In member function 'int TiXmlElement::AppendChild(const std::string&, const T&)':
tinyxml.h:1163: error: no matching function for call to 'TiXmlElement::InsertEndChild(TiXmlText&)'
tinyxml.h:587: note: candidates are: TiXmlNode* TiXmlNode::InsertEndChild(const TiXmlNode&)
gmake: *** [../../bld_default.mk:105: action_store.o] Error 1
Code
#ifdef TIXML_USE_STL
template < typename T >
int AppendChild( const std::string& name, const T& value )
{
std::ostringstream ss;
ss << value;
std::string valueStr = ss.str();
After I changed TiXmlText to TiXmlElement, I don't get any error but the xml reply is incorrect and missing few header elements as well as message body:
1 2 3 4 5 6 7 8 9 10 11
#ifdef TIXML_USE_STL
template < typename T >
int AppendChild( const std::string& name, const T& value )
{
std::ostringstream ss;
ss << value;
std::string valueStr = ss.str();
TiXmlElement textNode = (valueStr.c_str()) ;
//TiXmlText textNode = (valueStr.c_str()); //
TiXmlElement childElement = (name.c_str());