Hi Mario,
if you export a symbol from a DLL, you need to export also its base class
and the types of the public members; and this is incompatible with a static
library (that implies that the code is only available to the DLL being
compiled and not to its clients).
So either you need to ship Xerces as a DLL, or compile your project with
warnings hoping the automatic import of an exported symbol doesn't cause
bad behaviours.
Alberto
At 16.13 08/06/2005 +0200, Freimann Mario wrote:
Dear mailing list,
I'm developing under Win2000 Server SP4 with Microsoft Visual Studio 6
SP6. I'm using the xerces version 2.6.
I have a class AAA, which is derived from an error handler:
class __declspec(dllexport) AAA : public ErrorHandler
This class resides inside a static library and packages the xerces xml
parser. My application uses this library for linkage. In order to get a
static linked application I created a xerces static lib with the following
hints I got from the mailing list archive:
- created a new project of type static library
- added all files and settings of normal xerces lib
- replaced the file Win32MsgLoader with InMemMsgLoader in project
- defined XML_USE_INMEM_MESSAGELOADER instead of USE_WIN32_MESSAGELOADER
- cleared defines PLATFORM_EXPORT and PLATFORM_INPUT in VCPPDefs.hpp
Because my class AAA is dllexport but xerces ErrorHandler is not, the
static link of my whole application didn't find the ErrorHandler, so I
adjusted the ErrorHandler (ErrorHandler.hpp) class and added an
__declspec(dllexport). Now the whole thing links fine (my static lib and
the xerces static lib) and seems to work, too, but I get some linker
warnings and don't know whether they are important and how I can remove them.
LINK : warning LNK4049: locally defined symbol ""public: virtual
__thiscall xercesc_2_6::ErrorHandler::~ErrorHandler(void)"
([EMAIL PROTECTED]@@[EMAIL PROTECTED])" imported
LINK : warning LNK4049: locally defined symbol ""public: __thiscall
xercesc_2_6::ErrorHandler::ErrorHandler(void)"
([EMAIL PROTECTED]@@[EMAIL PROTECTED])" imported
LINK : warning LNK4049: locally defined symbol ""public: static void
__cdecl xercesc_2_6::XMLString::release(char * *)"
([EMAIL PROTECTED]@xercesc_2_6@@[EMAIL PROTECTED])" imported
LINK : warning LNK4049: locally defined symbol ""public: static char *
__cdecl xercesc_2_6::XMLString::transcode(unsigned short const * const)"
([EMAIL PROTECTED]@xercesc_2_6@@[EMAIL PROTECTED])" imported
LINK : warning LNK4049: locally defined symbol ""public: unsigned short
const * __thiscall xercesc_2_6::XMLException::getMessage(void)const "
([EMAIL PROTECTED]@xercesc_2_6@@QBEPBGXZ)" imported
LINK : warning LNK4049: locally defined symbol ""public: static void
__cdecl xercesc_2_6::XMLPlatformUtils::Terminate(void)"
([EMAIL PROTECTED]@xercesc_2_6@@SAXXZ)" imported
LINK : warning LNK4049: locally defined symbol ""public: static void
__cdecl xercesc_2_6::XMemory::operator delete(void *)"
([EMAIL PROTECTED]@@[EMAIL PROTECTED])" imported
LINK : warning LNK4049: locally defined symbol ""public: void __thiscall
xercesc_2_6::XercesDOMParser::setErrorHandler(class
xercesc_2_6::ErrorHandler * const)"
([EMAIL PROTECTED]@xercesc_2_6@@[EMAIL PROTECTED]@@Z)"
imported
LINK : warning LNK4049: locally defined symbol ""public: void __thiscall
xercesc_2_6::AbstractDOMParser::setDoSchema(bool)"
([EMAIL PROTECTED]@xercesc_2_6@@[EMAIL PROTECTED])" imported
LINK : warning LNK4049: locally defined symbol ""public: void __thiscall
xercesc_2_6::AbstractDOMParser::setDoNamespaces(bool)"
([EMAIL PROTECTED]@xercesc_2_6@@[EMAIL PROTECTED])" imported
LINK : warning LNK4049: locally defined symbol ""public: void __thiscall
xercesc_2_6::AbstractDOMParser::setIncludeIgnorableWhitespace(bool)"
([EMAIL PROTECTED]@xercesc_2_6@@[EMAIL PROTECTED])"
imported
LINK : warning LNK4049: locally defined symbol ""public: void __thiscall
xercesc_2_6::AbstractDOMParser::setValidationScheme(enum
xercesc_2_6::AbstractDOMParser::ValSchemes)"
([EMAIL PROTECTED]@xercesc_2_6@@[EMAIL PROTECTED]@@Z)"
imported
LINK : warning LNK4049: locally defined symbol ""public: __thiscall
xercesc_2_6::XercesDOMParser::XercesDOMParser(class
XercesDOMParser::XMLValidator * const,class XercesDOMParser::MemoryManager
* const,class XercesDOMParser::XMLGrammarPool * const)"
([EMAIL PROTECTED]@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@1@@Z)"
imported
LINK : warning LNK4049: locally defined symbol ""public: static class
xercesc_2_6::MemoryManager
* xercesc_2_6::XMLPlatformUtils::fgMemoryManager"
([EMAIL PROTECTED]@xercesc_2_6@@[EMAIL PROTECTED]@A)"
imported
LINK : warning LNK4049: locally defined symbol ""public: static void *
__cdecl xercesc_2_6::XMemory::operator new(unsigned int)"
([EMAIL PROTECTED]@@[EMAIL PROTECTED])" imported
LINK : warning LNK4049: locally defined symbol ""public: static void
__cdecl xercesc_2_6::XMLPlatformUtils::Initialize(char const * const,char
const * const,class xercesc_2_6::PanicHandler * const,class
xercesc_2_6::MemoryManager * const)"
([EMAIL PROTECTED]@xercesc_2_6@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@Z)"
imported
LINK : warning LNK4049: locally defined symbol ""public: static char const
* const xercesc_2_6::XMLUni::fgXercescDefaultLocale"
([EMAIL PROTECTED]@xercesc_2_6@@2QBDB)" imported
LINK : warning LNK4049: locally defined symbol ""public: virtual
__thiscall xercesc_2_6::XercesDOMParser::~XercesDOMParser(void)"
([EMAIL PROTECTED]@@[EMAIL PROTECTED])" imported
LINK : warning LNK4049: locally defined symbol ""public: static void
__cdecl xercesc_2_6::XMLString::release(unsigned short * *)"
([EMAIL PROTECTED]@xercesc_2_6@@[EMAIL PROTECTED])" imported
LINK : warning LNK4049: locally defined symbol ""public: void __thiscall
xercesc_2_6::AbstractDOMParser::parse(unsigned short const * const)"
([EMAIL PROTECTED]@xercesc_2_6@@[EMAIL PROTECTED])" imported
LINK : warning LNK4049: locally defined symbol ""public: static unsigned
short * __cdecl xercesc_2_6::XMLString::transcode(char const * const)"
([EMAIL PROTECTED]@xercesc_2_6@@[EMAIL PROTECTED])" imported
LINK : warning LNK4049: locally defined symbol ""public: void __thiscall
xercesc_2_6::AbstractDOMParser::parse(class xercesc_2_6::InputSource const
&)" ([EMAIL PROTECTED]@xercesc_2_6@@[EMAIL PROTECTED]@@Z)" imported
LINK : warning LNK4049: locally defined symbol ""public: __thiscall
xercesc_2_6::MemBufInputSource::MemBufInputSource(unsigned char const *
const,unsigned int,unsigned short const * const,bool,class
MemBufInputSource::MemoryManager * const)"
([EMAIL PROTECTED]@@[EMAIL PROTECTED]@1@@Z)"
imported
LINK : warning LNK4049: locally defined symbol ""public: virtual
__thiscall xercesc_2_6::MemBufInputSource::~MemBufInputSource(void)"
([EMAIL PROTECTED]@@[EMAIL PROTECTED])" imported
LINK : warning LNK4049: locally defined symbol ""public: class
xercesc_2_6::DOMDocument * __thiscall
xercesc_2_6::AbstractDOMParser::getDocument(void)"
([EMAIL PROTECTED]@xercesc_2_6@@[EMAIL PROTECTED]@XZ)" imported
LINK : warning LNK4049: locally defined symbol ""public: long __thiscall
xercesc_2_6::SAXParseException::getLineNumber(void)const "
([EMAIL PROTECTED]@xercesc_2_6@@QBEJXZ)" imported
LINK : warning LNK4049: locally defined symbol ""public: long __thiscall
xercesc_2_6::SAXParseException::getColumnNumber(void)const "
([EMAIL PROTECTED]@xercesc_2_6@@QBEJXZ)" imported
LINK : warning LNK4049: locally defined symbol ""public: unsigned short
const * __thiscall xercesc_2_6::SAXParseException::getSystemId(void)const
" ([EMAIL PROTECTED]@xercesc_2_6@@QBEPBGXZ)" imported
Thanks for your help on this in advance!
Regards
Mario Freimann
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]