I am still having the linker problem.

In my header file, I have this statement:
char *PrintDOMTree(DOM_Node &domNode, int &nLength);

PrintDOMTree is defined in our Print.cpp file.

When using the namespace, I get this error:
Utils.exp : error LNK2001: unresolved external symbol "char * __cdecl PrintDOMTree(class DOM_Node &,int &)" (?PrintDOMTree@@YAPADAAVDOM_Node@@[EMAIL PROTECTED])

If I understand the last post, I should change my header file to:
char *PrintDOMTree(xercesc::DOM_Node &domNode, int &nLength);

I tried this and I still got the linker error.  I also did the same thing in the .cpp file

using namespace xercesc;
.
.
.


char *PrintDOMTree(xercesc::DOM_Node &domNode, int &nLength)
{
.
.
}

Still get the linker error.  Did I misunderstand something?

Thanks,

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



"Adam Heinz" <[EMAIL PROTECTED]>

12/22/2003 12:30 PM
Please respond to xerces-c-dev

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



Your prototype is not in the Xerces namespace, so the linker is looking for function(obj*) when it needs function(Xerces::obj*).  XERCES_CPP_NAMESPACE use doesn't mean that everything you declare is Xerces::, it just means that if you use a symbol, your compiler will also check for Xerces::symbol if it can't match.
 
Are your users actually calling these functions directly?  Are you passing your users Xerces objects as "black boxes" and then receiving them back?
 
Adam Heinz
Development Consultant
Exstream Software

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


I'm not as concerned with the class prototype as I am with as to why MyFunction does not link correctly when I am using the xerces namespace.  I get a LNK2001 error.


Also, going through other developer's code and including needed headers instead of using class prototypes might make some people angry... as will making them use the xerces namespace.


I'm really just looking for the simplest way to upgrade so as not to cause problems.  If I actually have to go through and add the using namespace declaration, that would be tolerable, but at the moment there are still linking and qualifying issues as I have explained.


Thanks for your time, I really do appreciate it.


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


"Adam Heinz" <[EMAIL PROTECTED]>

12/22/2003 12:01 PM
Please respond to xerces-c-dev

       
       To:        <[EMAIL PROTECTED]>

       cc:        

       Subject:        RE: Disabling C++ Namespace




If you're already including Xerces headers in your header, why not just include the needed headers rather than use a class prototype?

Adam Heinz
Development Consultant
Exstream Software

Reply via email to