Re: [xml] Small Problem with libxml2 & MSVC++

On 06.05.2004 20:27, Christian Ehrlicher wrote:


I'm using libxml under win32 with the libs from But I needed to change two small things to get it working - dunno know if you maybe fixed this yet. in valid.h you are using a variable named "list" (line 366, 370). Don't know why, but when I included the stl <list> before, then the compiler complains that 'list' is something like a reserved word (or whatever, I normally don't use win32, but this time I must... ). When I change the parameter to something other (e.g. clist), then all works fine. Maybe you can change this also in your version so I don't need to patch your include-files everytime I use a newer version.

'list' is one of the standard container templates in STL. By the time the compiler parses valid.h, the 'list' is allready a C++ template and what you see is the result of using a name of the template as a function parameter name.

By that, I want to say that I expect every C++ compiler to report an error there, on every platform. Are you saying that you are seeing this only on Windows/MSVC?

Lastly, it is always a good practice... no it is even imperative to include C headers before C++ headers, if you use C libraries in a C++ program. Include libxml, then include STL. That is the only long-term solution. Modifying libxml headers will help with libxml, but not with any other useful C library you might want to employ in the future.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]