Re: [xml] VC6, STL and VALID.H header error during compilation



On Tue, Mar 08, 2005 at 03:06:08PM +0100, Samuel D?az Garc?a wrote:
In line 401, there are a function argument named "list" that produce
an error compiling mfc apps with vc6.

A solution found is substitute "list" by "_list".

The problem encountered is that my apps use STL and the argument
"list" conflicts with the "std::list" template implementation in vc6.

Can anybody change the argument name in valid.h header or say me what
workaround can I make to solve the compile error?

I don't know any specifics for VC6, but with most C++ compilers the
non-standard #include <list.h> will define list at global scope, while
#include <list> will define it in the std namespace.  If you use the
latter you shouldn't have a problem.  You might also be able to work
around the problem by including libxml headers first in your compilation
unit.

I use the "using namespace std" in all .cpp files that uses STL
templates.

You should only do this after all #include statements, perhaps that is
your problem.

Either way, it's certainly not the responsibility of libxml2 to avoid
this kind of name clash.

hth,

Graham.

-- 
Graham Bennett



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