Okay, let's say that I have this in my header file:

#include <xercesc/framework/LocalFileFormatTarget.hpp>
#include <xercesc/util/PlatformUtils.hpp>
#include <xercesc/util/XMLString.hpp>
#include <xercesc/util/XMLUni.hpp>

#include "MyHeader.h"

class InputSource;

char *MyFunction(Node &var1, int &var2);
.
.
.



MyFunction is defined in a header that I wrote, MyHeader.h


Now, if I include the namespace directive:

#include <xercesc/framework/LocalFileFormatTarget.hpp>
#include <xercesc/util/PlatformUtils.hpp>
#include <xercesc/util/XMLString.hpp>
#include <xercesc/util/XMLUni.hpp>

#include "MyHeader.h"

XERCES_CPP_NAMESPACE_USE

// I now have to qualify this class since it's defined in another xerces file.
class xercesc::InputSource;

// I also have linking errors with MyFunction when I use the Xerces namespace directive.
// I'm not sure why this occurs, I can only guess that it's unclear where the linker should
// look to find the function due to the namespace? Not sure why it can't link to MyHeader.h
char *MyFunction(Node &var1, int &var2);
.
.
.


If the Namespace is enabled, all developers on this project that use the xerces functions
have to add "XERCES_CPP_NAMESPACE_USE" to their files (or at least to some header somewhere), plus qualify forward functions, etc. PLUS I
can't even get MY files to link correctly.  We do not want the other developers to have to be aware that xerces was upgraded.

Thanks,

Stephanie Milchak
Software Engineer
WebSphere Business Integration
Research Triangle Park, NC



"Adam Heinz" <[EMAIL PROTECTED]>

12/22/2003 11:05 AM
Please respond to xerces-c-dev

       
        To:        <[EMAIL PROTECTED]>
        cc:        
        Subject:        RE: Disabling C++ Namespace



Could you give me a code sample from one of your interface header files?

Adam Heinz
Development Consultant
Exstream Software

-----Original Message-----
From:
Stephanie L Milchak [mailto:[EMAIL PROTECTED]
Sent:
Monday, December 22, 2003 10:49 AM
To:
[EMAIL PROTECTED]
Subject:
RE: Disabling C++ Namespace


I still have to qualify forward functions and any function/variable that could be ambiguous.  This is not desirable since many developers use the xerces functions and we would like to make the upgrade transparent to them.


Stephanie Milchak
Software Engineer
WebSphere Business Integration
919.543.4069
Research Triangle Park, NC


Reply via email to