Andrew,

My guess is you are using version 1.0?

Version 1.1 now has the following definition :

#define XSEC_DECLARE_XERCES_CLASS(NAME) namespace XERCES_CPP_NAMESPACE { class NAME; }

I.e. it doesn't import DOMDocument into the current namespace.

This is a problem with VC .NET where there is a Microsoft definition of DOMDocument that clashes with Xerces if you aren't careful (and we weren't in 1.0 :>.)

Version 1.1 keeps everything in the Xerces namespace, except in the actual cpp files (where it doesn't matter).

CHeers,
        Berin

Andrew wrote:

Good day,

I have never come across this problem before and I am not sure how to go about fixing it. So any assisstance would be greatly appreciated.

I am working under VS .Net

I have one project file building a DLL which links in Xerces,XSec etc. with no problem.

I have another exe project that is linking in the lib created from the above dll.

I am #include'ing an .h file from the DLL project in my .exe project.
This results in a chain of #include's to XSec class that raise the following compilation error (or variation of this error w.r.t. different files).


\xsec\dsig\DSIGTransform.hpp(80) : error C2874: using-declaration causes a multiple declaration of 'xercesc_2_4::DOMDocument'
\Xerces\include\xercesc\dom\DOMDocument.hpp(103) : see declaration of 'xercesc_2_4::DOMDocument'


The DSIGTranform uses XSEC_DECLARE_XERCES_CLASS macro to forward declare the DOMDocument class, which is later defined by DOMDocument itself.

None of the other classes such as DOMNode that are forward declared cause any problems, just DOMDocument.

I've attempted to unwind the #include order to see if that turned up anything, but it hasn't.

I'll include the def'n of the macro here for completeness:
#define XSEC_DECLARE_XERCES_CLASS(NAME) namespace XERCES_CPP_NAMESPACE { class NAME; } using XERCES_CPP_NAMESPACE::NAME


Thanks in advance for any help you could provide

Andrew



Reply via email to