Menu

TIXML_USE_STL on 1.3.0

2007-05-07
2013-04-30
  • Arto Viitanen

    Arto Viitanen - 2007-05-07

    I fetched TinyXPath 1.3.0 (actually, I had to fetch Windows .zip, since the .tar.gz was compressed using
    compression OS X did not understand) and compiled it. It worked fine, so I dropped the main.cpp and htmlutil.*
    as told. I made it a Eclipse CDT static archive process. Then I ported my libxml++ program to use TinyXPath.
    Since I used quite a lot STL containers, it seemed logical to use TIXML_USE_STL macro (which makes TinyXPath
    to use stl string). But, I got error "invalid use of undefined type struct std::stringsteam" on file tinyxml.h.

    I tested on different C++ compilers, and it turn out that the error occured only on GNU C++ 4.1.2 which comes
    with OpenSuSE 10.2. The error can be fixed by adding #include <sstream> on line 51 on tinyxml.h; where

    #ifdef TIXML_USE_STL
        #include <string>
        #include <iostream>
    ... HERE #include <sstream>
    ..
    #else
    #endif

    As I said, this occures only on GNU C++ 4.1.2 on OpenSuSE 10.2. On Gnu C++ 4.0.1 on OS X 10.4.9 or Intel's
    C++ on OpenSuSE (I don't remember version number), the error did not occur.

     
    • Yves Berquin

      Yves Berquin - 2007-05-17

      I would try using the 2.5.3 version of TinyXML to see if this fixes the problem. You can overwrite the TinyXML files from TinyXPath distribution with those from TinyXML (tinyxml.*, tinyxmlerror.cpp, tinyxmlparser.cpp and tinystr.*).

       

Log in to post a comment.