You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by AYDOS Carlos C <Ca...@rta.nsw.gov.au> on 2007/11/25 23:47:55 UTC

namespace problem?

Hi,

 

I am a newbie in Xerces-C++. I managed to write my first few
applications without any problems. But I am having problems to write a
plugin (dll) to a third party application. This third party application
uses Xerces 2.7.0. My dll also uses Xerces 2.7.0 but for totally
different purposes. As I do not know the internals of the application I
cannot figure out what is happening, but the application returns an
error when tries to link to my dll function specifically where I
initialize Xerces. If I use Xerces 2.6.0 (a different version) for my
plugin, everything seems to work ok. This is a good temporary solution,
but I would like to know what is going on. So I guess I am forgetting to
declare something, define perhaps a namespace, etc. Does anyone have an
idea of what I might be doing wrong? The application developers told me
they use XERCES_CPP_NAMESPACE_USE and so do I on my plugin.

 

Carlos


IMPORTANT NOTICE: This e-mail and any attachment to it are intended only to be read or used by the named addressee. It is confidential and may contain legally privileged information. No confidentiality or privilege is waived or lost by any mistaken transmission to you. The RTA is not responsible for any unauthorised alterations to this e-mail or attachment to it. Views expressed in this message are those of the individual sender, and are not necessarily the views of the RTA. If you receive this e-mail in error, please immediately delete it from your system and notify the sender. You must not disclose, copy or use any part of this e-mail if you are not the intended recipient.

Re: namespace problem?

Posted by David Bertoni <db...@apache.org>.
AYDOS Carlos C wrote:
> Hi,
> 
>  
> 
> I am a newbie in Xerces-C++. I managed to write my first few
> applications without any problems. But I am having problems to write a
> plugin (dll) to a third party application. This third party application
> uses Xerces 2.7.0. My dll also uses Xerces 2.7.0 but for totally
> different purposes. As I do not know the internals of the application I
> cannot figure out what is happening, but the application returns an
> error when tries to link to my dll function specifically where I
> initialize Xerces. If I use Xerces 2.6.0 (a different version) for my
> plugin, everything seems to work ok. This is a good temporary solution,
> but I would like to know what is going on. So I guess I am forgetting to
> declare something, define perhaps a namespace, etc. Does anyone have an
> idea of what I might be doing wrong? The application developers told me
> they use XERCES_CPP_NAMESPACE_USE and so do I on my plugin.
Using XERCES_CPP_NAMESPACE_USE has no affect on the actual C++ namespace 
for the Xerces-C version you're using.  This sounds like a conflict between 
how the other library is using Xerces-C and how your plugin is using it.

If you can't find out any details about how the other application is using 
Xerces-C, then your best bet is to build a custom version using a unique 
file name, and a unique C++ namespace. For example, you might append a 
string of characters to both the file name and the C++ namespace that 
associate it with your application.

Dave