You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Milan Tomic <mi...@setcce.org> on 2004/05/12 12:12:23 UTC

RE: Linking Xerces C++ statically

Erik,

	I did as you said but got some linker errors while trying to use
Xerces.lib in my projects:

Linking...
MSVCRT.lib(MSVCR71.dll) : error LNK2005: _strncmp already defined in
libcmt.lib(strncmp.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: _isspace already defined in
libcmt.lib(_ctype.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: __errno already defined in
libcmt.lib(dosmap.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: _exit already defined in
libcmt.lib(crt0dat.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: _atoi already defined in
libcmt.lib(atox.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: _strchr already defined in
libcmt.lib(strchr.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: __itoa already defined in
libcmt.lib(xtoa.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: _localeconv already defined in
libcmt.lib(lconv.obj)
MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __thiscall
type_info::type_info(class type_info const &)"
(??0type_info@@AAE@ABV0@@Z) already defined in libcmt.lib(typinfo.obj)
MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: class type_info &
__thiscall type_info::operator=(class type_info const &)"
(??4type_info@@AAEAAV0@ABV0@@Z) already defined in
libcmt.lib(typinfo.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: __stricmp already defined in
libcmt.lib(stricmp.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: __strnicmp already defined in
libcmt.lib(strnicmp.obj)
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other
libs; use /NODEFAULTLIB:library
Release/XercesTest.exe : fatal error LNK1169: one or more multiply
defined symbols found

The reason for those errors is that I'm using MFC. When I link them as
shared lib, there are no errors, but I'd like to link MFC as static lib.
Are you using MFC? Is there a hope? Anyone?

Thank you,
Milan


> -----Original Message-----
> From: Erik Rydgren [mailto:erik.rydgren@mandarinen.se] 
> Sent: Tuesday, February 17, 2004 10:16 AM
> To: xerces-c-dev@xml.apache.org
> Subject: RE: Linking Xerces C++ statically
> 
> 
> We link Xerces statically with MS devstudio.
> How to do it:
> 
> - First change the project type from dll to static lib.
> - Remove the Win32MsgLoader from the project and add the 
> InMemMsgLoader instead.
> - Change the project settings to define 
> XML_USE_INMEM_MESSAGELOADER instead of USE_WIN32_MESSAGELOADER.
> - Change the defines for PLATFORM_EXPORT and PLATFORM_IMPORT 
> by removing the _declspec(dllexport) and _declspec(dllimport)
> - Rebuild.
> 
> Hope I didn't forget anything.
> 
> Good luck
> Erik Rydgren
> Aptic AB
> Sweden
> 
> > -----Original Message-----
> > From: Chaudhuri, Hiran [mailto:Hiran.Chaudhuri@softwareag.com]
> > Sent: den 16 februari 2004 17:51
> > To: xerces-c-dev@xml.apache.org
> > Subject: Linking Xerces C++ statically
> > 
> > Hi there.
> > 
> > In the docs it is stated that Xerces C++ requires 
> xerces-2.4.0.dll (on
> > Windows) to be distributed. Is it possible to have Xerces linked 
> > statically so I do not need to distribute the DLL?
> > 
> > Hiran
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> > For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


RE: Linking Xerces C++ statically

Posted by Milan Tomic <mi...@setcce.org>.
Hi Dave,

> Are you building a debug configuration?
No.

> Did 
> you dump the symbols from the Xerces-C library you built to 
> see if these missing symbols are defined?
How can I do that? I have one Borland tool (tdump) that do that, but it
works only with .dll files and not with .lib files.

Thank you,
Milan



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


RE: Linking Xerces C++ statically

Posted by da...@us.ibm.com.
> > Xalan-C does not define or use the Xerces-C macros that
> > affect Xerces-C's class export macros.  You should look very
> > carefully at what you did to build Xerces-C as a static
> > library and make sure have modified the following lines in
> > xercesc/util/Compilers/VCPPDefs.hpp:
> >
> >    #define PLATFORM_EXPORT     __declspec(dllexport)
> >    #define PLATFORM_IMPORT     __declspec(dllimport)
> >
> > to
> >
> >    #define PLATFORM_EXPORT
> >    #define PLATFORM_IMPORT
> Yes, I did that. And I've succeeded to link Xerces 2.5 as static lib
> with my test project.
>
> Interesting is that setExpandEntityReferences(bool) function is the only
> unresolved function here. All other unresolved simbols are
> ctors/dectors. Does anyone have any idea why this func is different then
> the others?

Are you building a debug configuration?  There may be issues with
generating out-of-line copies of inline functions.  Some of them are also
virtual and defined in the header file, so perhaps the compiler has no way
of knowing where to place an out-of-line copy in the Xerces library, so it
doesn't.  Did you dump the symbols from the Xerces-C library you built to
see if these missing symbols are defined?

Dave


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


RE: Linking Xerces C++ statically

Posted by Milan Tomic <mi...@setcce.org>.
> Xalan-C does not define or use the Xerces-C macros that 
> affect Xerces-C's class export macros.  You should look very 
> carefully at what you did to build Xerces-C as a static 
> library and make sure have modified the following lines in 
> xercesc/util/Compilers/VCPPDefs.hpp:
> 
>    #define PLATFORM_EXPORT     __declspec(dllexport)
>    #define PLATFORM_IMPORT     __declspec(dllimport)
> 
> to
> 
>    #define PLATFORM_EXPORT
>    #define PLATFORM_IMPORT
Yes, I did that. And I've succeeded to link Xerces 2.5 as static lib
with my test project.

Interesting is that setExpandEntityReferences(bool) function is the only
unresolved function here. All other unresolved simbols are
ctors/dectors. Does anyone have any idea why this func is different then
the others?

Thank you very much for your help,
Milan



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


RE: Linking Xerces C++ statically

Posted by da...@us.ibm.com.
>
>            I'm using Windows XP search mechanism and can't find any of
them
> (dllimport keyword). :( Can you recommend some better tool?
>
> Thank you,
> Milan

Xalan-C does not define or use the Xerces-C macros that affect Xerces-C's
class export macros.  You should look very carefully at what you did to
build Xerces-C as a static library and make sure have modified the
following lines in xercesc/util/Compilers/VCPPDefs.hpp:

   #define PLATFORM_EXPORT     __declspec(dllexport)
   #define PLATFORM_IMPORT     __declspec(dllimport)

to

   #define PLATFORM_EXPORT
   #define PLATFORM_IMPORT

Dave


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


RE: Linking Xerces C++ statically

Posted by Milan Tomic <mi...@setcce.org>.
	I'm using Windows XP search mechanism and can't find any of them
(dllimport keyword). :( Can you recommend some better tool?

Thank you,
Milan


> -----Original Message-----
> From: Alberto Massari [mailto:amassari@progress.com] 
> Sent: Thursday, May 13, 2004 5:53 PM
> To: xerces-c-dev@xml.apache.org
> Subject: RE: Linking Xerces C++ statically
> 
> 
> Hi Milan,
> 
> The symbols all have __declspec(dllimport), but you are now 
> building static 
> libraries, that don't have that in the signature. Can you 
> check your Xalan 
> sources to find out which macro is associated with that 
> directive and make 
> it empty.
> 
> Alberto
> 
> At 17.47 13/05/2004 +0200, Milan Tomic wrote:
> 
> >I've tried to link Xalan as static lib, but I got 11 linker errors 
> >(unresolved externals). Linker can't find 11 Xerces 
> >constructors/destructors, that Xalan is using. I'm using Xerces 2.5 
> >with Xalan 1.6. Does anyone have any idea why this happen? 
> There have 
> >to be some solution... maybe something with namespaces...?
> >
> >I belive I'll find on this mailing list someone more familiar with 
> >Xerces then I am, who could explain why those few classes 
> >(ErrorHandler, LexicalHandler, DTDHandler, 
> ContentHandler...) and their 
> >ctors/destructors are different then the others.
> >
> >I'm attaching .txt file with linker output.
> >
> >Thank you all guys for your help. :>
> >Milan
> >
> >
> > > -----Original Message-----
> > > From: Erik Rydgren [mailto:erik.rydgren@mandarinen.se]
> > > Sent: Thursday, May 13, 2004 10:58 AM
> > > To: xerces-c-dev@xml.apache.org
> > > Subject: RE: Linking Xerces C++ statically
> > >
> > >
> > > Yes we have done the same thing with Xalan. I can't remember the 
> > > details anymore but it is very similar to the Xerces conversion.
> > >
> > > Good luck
> > > / Erik
> > >
> > > > -----Original Message-----
> > > > From: Milan Tomic [mailto:milan@setcce.org]
> > > > Sent: den 12 maj 2004 16:13
> > > > To: xerces-c-dev@xml.apache.org
> > > > Subject: RE: Linking Xerces C++ statically
> > > >
> > > >
> > > > Thank you. I've succeeded to link Xerces as static lib, but
> > > now I need
> > > > to link Xalan as static lib, too. Have anyone succeded this
> > > using VC6
> > > or
> > > > VC7?
> > > >
> > > >
> > > >
> > > > > -----Original Message-----
> > > > > From: Alberto Massari [mailto:amassari@progress.com]
> > > > > Sent: Wednesday, May 12, 2004 1:20 PM
> > > > > To: xerces-c-dev@xml.apache.org
> > > > > Subject: RE: Linking Xerces C++ statically
> > > > >
> > > > >
> > > > > Hi Erik,
> > > > > if you want to link against the static version of MFC,
> > > you need to
> > > > > rebuild the Xerces library using the "Debug 
> Multithreaded" and 
> > > > > "Multithreaded" setting (/MTd and /MT), instead of "Debug 
> > > > > Multithreaded DLL" and "Multithreaded DLL" (/MDd and /MD)
> > > > >
> > > > > Alberto
> > > > >
> > > > > At 12.12 12/05/2004 +0200, Milan Tomic wrote:
> > > > > >Erik,
> > > > > >
> > > > > >         I did as you said but got some linker errors while
> > > > > trying to
> > > > > >use Xerces.lib in my projects:
> > > > > >
> > > > > >Linking...
> > > > > >MSVCRT.lib(MSVCR71.dll) : error LNK2005: _strncmp already 
> > > > > >defined
> > > in
> > > > > >libcmt.lib(strncmp.obj)
> > > > > >MSVCRT.lib(MSVCR71.dll) : error LNK2005: _isspace already 
> > > > > >defined
> > > in
> > > > > >libcmt.lib(_ctype.obj)
> > > > > >MSVCRT.lib(MSVCR71.dll) : error LNK2005: __errno already
> > > defined in
> > > > > >libcmt.lib(dosmap.obj)
> > > > > >MSVCRT.lib(MSVCR71.dll) : error LNK2005: _exit 
> already defined 
> > > > > >in
> > > > > >libcmt.lib(crt0dat.obj)
> > > > > >MSVCRT.lib(MSVCR71.dll) : error LNK2005: _atoi 
> already defined in
> > > > > >libcmt.lib(atox.obj)
> > > > > >MSVCRT.lib(MSVCR71.dll) : error LNK2005: _strchr already
> > > defined in
> > > > > >libcmt.lib(strchr.obj)
> > > > > >MSVCRT.lib(MSVCR71.dll) : error LNK2005: __itoa already
> > > defined in
> > > > > >libcmt.lib(xtoa.obj)
> > > > > >MSVCRT.lib(MSVCR71.dll) : error LNK2005: _localeconv already
> > > > > defined in
> > > > > >libcmt.lib(lconv.obj)
> > > > > >MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: 
> __thiscall 
> > > > > >type_info::type_info(class type_info const &)"
> > > > > >(??0type_info@@AAE@ABV0@@Z) already defined in
> > > > > libcmt.lib(typinfo.obj)
> > > > > >MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: class
> > > type_info
> > > &
> > > > > >__thiscall type_info::operator=(class type_info const &)"
> > > > > >(??4type_info@@AAEAAV0@ABV0@@Z) already defined in
> > > > > >libcmt.lib(typinfo.obj)
> > > > > >MSVCRT.lib(MSVCR71.dll) : error LNK2005: __stricmp
> > > already defined
> > > in
> > > > > >libcmt.lib(stricmp.obj)
> > > > > >MSVCRT.lib(MSVCR71.dll) : error LNK2005: __strnicmp already
> > > > > defined in
> > > > > >libcmt.lib(strnicmp.obj)
> > > > > >LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with
> > > > > use of other
> > > > > >libs; use /NODEFAULTLIB:library 
> Release/XercesTest.exe : fatal
> > > error
> > > > > >LNK1169: one or more multiply defined symbols found
> > > > > >
> > > > > >The reason for those errors is that I'm using MFC. When I
> > > > > link them as
> > > > > >shared lib, there are no errors, but I'd like to link
> > > MFC as static
> > > > > >lib. Are you using MFC? Is there a hope? Anyone?
> > > > > >
> > > > > >Thank you,
> > > > > >Milan
> > > > > >
> > > > > >
> > > > > > > -----Original Message-----
> > > > > > > From: Erik Rydgren [mailto:erik.rydgren@mandarinen.se]
> > > > > > > Sent: Tuesday, February 17, 2004 10:16 AM
> > > > > > > To: xerces-c-dev@xml.apache.org
> > > > > > > Subject: RE: Linking Xerces C++ statically
> > > > > > >
> > > > > > >
> > > > > > > We link Xerces statically with MS devstudio.
> > > > > > > How to do it:
> > > > > > >
> > > > > > > - First change the project type from dll to static lib.
> > > > > > > - Remove the Win32MsgLoader from the project and add the 
> > > > > > > InMemMsgLoader instead.
> > > > > > > - Change the project settings to define
> > > > > XML_USE_INMEM_MESSAGELOADER
> > > > > > > instead of USE_WIN32_MESSAGELOADER.
> > > > > > > - Change the defines for PLATFORM_EXPORT and
> > > PLATFORM_IMPORT by
> > > > > > > removing the _declspec(dllexport) and _declspec(dllimport)
> > > > > > > - Rebuild.
> > > > > > >
> > > > > > > Hope I didn't forget anything.
> > > > > > >
> > > > > > > Good luck
> > > > > > > Erik Rydgren
> > > > > > > Aptic AB
> > > > > > > Sweden
> > > > > > >
> > > > > > > > -----Original Message-----
> > > > > > > > From: Chaudhuri, Hiran
> > > [mailto:Hiran.Chaudhuri@softwareag.com]
> > > > > > > > Sent: den 16 februari 2004 17:51
> > > > > > > > To: xerces-c-dev@xml.apache.org
> > > > > > > > Subject: Linking Xerces C++ statically
> > > > > > > >
> > > > > > > > Hi there.
> > > > > > > >
> > > > > > > > In the docs it is stated that Xerces C++ requires
> > > > > > > xerces-2.4.0.dll (on
> > > > > > > > Windows) to be distributed. Is it possible to have
> > > > > Xerces linked
> > > > > > > > statically so I do not need to distribute the DLL?
> > > > > > > >
> > > > > > > > Hiran
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > >
> > > 
> --------------------------------------------------------------------
> > > > > > > -
> > > > > > > > To unsubscribe, e-mail:
> > > xerces-c-dev-unsubscribe@xml.apache.org
> > > > > > > > For additional commands, e-mail:
> > > > > xerces-c-dev-help@xml.apache.org
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > >
> > > 
> --------------------------------------------------------------------
> > > > > > > -
> > > > > > > To unsubscribe, e-mail:
> > > xerces-c-dev-unsubscribe@xml.apache.org
> > > > > > > For additional commands, e-mail:
> > > xerces-c-dev-help@xml.apache.org
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > 
> >-------------------------------------------------------------------
> > > >--
> > > > > >To unsubscribe, e-mail: 
> xerces-c-dev-unsubscribe@xml.apache.org
> > > > > >For additional commands, e-mail: 
> > > > > >xerces-c-dev-help@xml.apache.org
> > > > >
> > > > >
> > > > >
> > > > >
> > > 
> --------------------------------------------------------------------
> > > -
> > > > > To unsubscribe, e-mail: 
> xerces-c-dev-unsubscribe@xml.apache.org
> > > > > For additional commands, e-mail: 
> > > > > xerces-c-dev-help@xml.apache.org
> > > > >
> > > >
> > > >
> > > >
> > > >
> > > 
> --------------------------------------------------------------------
> > > -
> > > > To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> > > > For additional commands, e-mail: 
> xerces-c-dev-help@xml.apache.org
> > >
> > >
> > >
> > > 
> --------------------------------------------------------------------
> > > -
> > > To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> > > For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
> > >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> >For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


RE: Linking Xerces C++ statically

Posted by Alberto Massari <am...@progress.com>.
Hi Milan,

The symbols all have __declspec(dllimport), but you are now building static 
libraries, that don't have that in the signature. Can you check your Xalan 
sources to find out which macro is associated with that directive and make 
it empty.

Alberto

At 17.47 13/05/2004 +0200, Milan Tomic wrote:

>I've tried to link Xalan as static lib, but I got 11 linker errors
>(unresolved externals). Linker can't find 11 Xerces
>constructors/destructors, that Xalan is using. I'm using Xerces 2.5 with
>Xalan 1.6. Does anyone have any idea why this happen? There have to be
>some solution... maybe something with namespaces...?
>
>I belive I'll find on this mailing list someone more familiar with
>Xerces then I am, who could explain why those few classes (ErrorHandler,
>LexicalHandler, DTDHandler, ContentHandler...) and their
>ctors/destructors are different then the others.
>
>I'm attaching .txt file with linker output.
>
>Thank you all guys for your help. :>
>Milan
>
>
> > -----Original Message-----
> > From: Erik Rydgren [mailto:erik.rydgren@mandarinen.se]
> > Sent: Thursday, May 13, 2004 10:58 AM
> > To: xerces-c-dev@xml.apache.org
> > Subject: RE: Linking Xerces C++ statically
> >
> >
> > Yes we have done the same thing with Xalan. I can't remember
> > the details anymore but it is very similar to the Xerces conversion.
> >
> > Good luck
> > / Erik
> >
> > > -----Original Message-----
> > > From: Milan Tomic [mailto:milan@setcce.org]
> > > Sent: den 12 maj 2004 16:13
> > > To: xerces-c-dev@xml.apache.org
> > > Subject: RE: Linking Xerces C++ statically
> > >
> > >
> > > Thank you. I've succeeded to link Xerces as static lib, but
> > now I need
> > > to link Xalan as static lib, too. Have anyone succeded this
> > using VC6
> > or
> > > VC7?
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Alberto Massari [mailto:amassari@progress.com]
> > > > Sent: Wednesday, May 12, 2004 1:20 PM
> > > > To: xerces-c-dev@xml.apache.org
> > > > Subject: RE: Linking Xerces C++ statically
> > > >
> > > >
> > > > Hi Erik,
> > > > if you want to link against the static version of MFC,
> > you need to
> > > > rebuild the Xerces library using the "Debug Multithreaded" and
> > > > "Multithreaded"
> > > > setting (/MTd and /MT), instead of "Debug Multithreaded DLL" and
> > > > "Multithreaded DLL" (/MDd and /MD)
> > > >
> > > > Alberto
> > > >
> > > > At 12.12 12/05/2004 +0200, Milan Tomic wrote:
> > > > >Erik,
> > > > >
> > > > >         I did as you said but got some linker errors while
> > > > trying to
> > > > >use Xerces.lib in my projects:
> > > > >
> > > > >Linking...
> > > > >MSVCRT.lib(MSVCR71.dll) : error LNK2005: _strncmp already defined
> > in
> > > > >libcmt.lib(strncmp.obj)
> > > > >MSVCRT.lib(MSVCR71.dll) : error LNK2005: _isspace already defined
> > in
> > > > >libcmt.lib(_ctype.obj)
> > > > >MSVCRT.lib(MSVCR71.dll) : error LNK2005: __errno already
> > defined in
> > > > >libcmt.lib(dosmap.obj)
> > > > >MSVCRT.lib(MSVCR71.dll) : error LNK2005: _exit already defined in
> > > > >libcmt.lib(crt0dat.obj)
> > > > >MSVCRT.lib(MSVCR71.dll) : error LNK2005: _atoi already defined in
> > > > >libcmt.lib(atox.obj)
> > > > >MSVCRT.lib(MSVCR71.dll) : error LNK2005: _strchr already
> > defined in
> > > > >libcmt.lib(strchr.obj)
> > > > >MSVCRT.lib(MSVCR71.dll) : error LNK2005: __itoa already
> > defined in
> > > > >libcmt.lib(xtoa.obj)
> > > > >MSVCRT.lib(MSVCR71.dll) : error LNK2005: _localeconv already
> > > > defined in
> > > > >libcmt.lib(lconv.obj)
> > > > >MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __thiscall
> > > > >type_info::type_info(class type_info const &)"
> > > > >(??0type_info@@AAE@ABV0@@Z) already defined in
> > > > libcmt.lib(typinfo.obj)
> > > > >MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: class
> > type_info
> > &
> > > > >__thiscall type_info::operator=(class type_info const &)"
> > > > >(??4type_info@@AAEAAV0@ABV0@@Z) already defined in
> > > > >libcmt.lib(typinfo.obj)
> > > > >MSVCRT.lib(MSVCR71.dll) : error LNK2005: __stricmp
> > already defined
> > in
> > > > >libcmt.lib(stricmp.obj)
> > > > >MSVCRT.lib(MSVCR71.dll) : error LNK2005: __strnicmp already
> > > > defined in
> > > > >libcmt.lib(strnicmp.obj)
> > > > >LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with
> > > > use of other
> > > > >libs; use /NODEFAULTLIB:library Release/XercesTest.exe : fatal
> > error
> > > > >LNK1169: one or more multiply defined symbols found
> > > > >
> > > > >The reason for those errors is that I'm using MFC. When I
> > > > link them as
> > > > >shared lib, there are no errors, but I'd like to link
> > MFC as static
> > > > >lib. Are you using MFC? Is there a hope? Anyone?
> > > > >
> > > > >Thank you,
> > > > >Milan
> > > > >
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Erik Rydgren [mailto:erik.rydgren@mandarinen.se]
> > > > > > Sent: Tuesday, February 17, 2004 10:16 AM
> > > > > > To: xerces-c-dev@xml.apache.org
> > > > > > Subject: RE: Linking Xerces C++ statically
> > > > > >
> > > > > >
> > > > > > We link Xerces statically with MS devstudio.
> > > > > > How to do it:
> > > > > >
> > > > > > - First change the project type from dll to static lib.
> > > > > > - Remove the Win32MsgLoader from the project and add the
> > > > > > InMemMsgLoader instead.
> > > > > > - Change the project settings to define
> > > > XML_USE_INMEM_MESSAGELOADER
> > > > > > instead of USE_WIN32_MESSAGELOADER.
> > > > > > - Change the defines for PLATFORM_EXPORT and
> > PLATFORM_IMPORT by
> > > > > > removing the _declspec(dllexport) and _declspec(dllimport)
> > > > > > - Rebuild.
> > > > > >
> > > > > > Hope I didn't forget anything.
> > > > > >
> > > > > > Good luck
> > > > > > Erik Rydgren
> > > > > > Aptic AB
> > > > > > Sweden
> > > > > >
> > > > > > > -----Original Message-----
> > > > > > > From: Chaudhuri, Hiran
> > [mailto:Hiran.Chaudhuri@softwareag.com]
> > > > > > > Sent: den 16 februari 2004 17:51
> > > > > > > To: xerces-c-dev@xml.apache.org
> > > > > > > Subject: Linking Xerces C++ statically
> > > > > > >
> > > > > > > Hi there.
> > > > > > >
> > > > > > > In the docs it is stated that Xerces C++ requires
> > > > > > xerces-2.4.0.dll (on
> > > > > > > Windows) to be distributed. Is it possible to have
> > > > Xerces linked
> > > > > > > statically so I do not need to distribute the DLL?
> > > > > > >
> > > > > > > Hiran
> > > > > > >
> > > > > > >
> > > > > >
> > > >
> > --------------------------------------------------------------------
> > > > > > -
> > > > > > > To unsubscribe, e-mail:
> > xerces-c-dev-unsubscribe@xml.apache.org
> > > > > > > For additional commands, e-mail:
> > > > xerces-c-dev-help@xml.apache.org
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > >
> > --------------------------------------------------------------------
> > > > > > -
> > > > > > To unsubscribe, e-mail:
> > xerces-c-dev-unsubscribe@xml.apache.org
> > > > > > For additional commands, e-mail:
> > xerces-c-dev-help@xml.apache.org
> > > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > >---------------------------------------------------------------------
> > > > >To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> > > > >For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
> > > >
> > > >
> > > >
> > > >
> > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> > > > For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
> > > >
> > >
> > >
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> > > For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> > For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
> >
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
>For additional commands, e-mail: xerces-c-dev-help@xml.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


RE: Linking Xerces C++ statically

Posted by Milan Tomic <mi...@setcce.org>.
I've tried to link Xalan as static lib, but I got 11 linker errors
(unresolved externals). Linker can't find 11 Xerces
constructors/destructors, that Xalan is using. I'm using Xerces 2.5 with
Xalan 1.6. Does anyone have any idea why this happen? There have to be
some solution... maybe something with namespaces...?

I belive I'll find on this mailing list someone more familiar with
Xerces then I am, who could explain why those few classes (ErrorHandler,
LexicalHandler, DTDHandler, ContentHandler...) and their
ctors/destructors are different then the others.

I'm attaching .txt file with linker output.

Thank you all guys for your help. :>
Milan


> -----Original Message-----
> From: Erik Rydgren [mailto:erik.rydgren@mandarinen.se] 
> Sent: Thursday, May 13, 2004 10:58 AM
> To: xerces-c-dev@xml.apache.org
> Subject: RE: Linking Xerces C++ statically
> 
> 
> Yes we have done the same thing with Xalan. I can't remember 
> the details anymore but it is very similar to the Xerces conversion.
> 
> Good luck
> / Erik
> 
> > -----Original Message-----
> > From: Milan Tomic [mailto:milan@setcce.org]
> > Sent: den 12 maj 2004 16:13
> > To: xerces-c-dev@xml.apache.org
> > Subject: RE: Linking Xerces C++ statically
> > 
> > 
> > Thank you. I've succeeded to link Xerces as static lib, but 
> now I need 
> > to link Xalan as static lib, too. Have anyone succeded this 
> using VC6
> or
> > VC7?
> > 
> > 
> > 
> > > -----Original Message-----
> > > From: Alberto Massari [mailto:amassari@progress.com]
> > > Sent: Wednesday, May 12, 2004 1:20 PM
> > > To: xerces-c-dev@xml.apache.org
> > > Subject: RE: Linking Xerces C++ statically
> > >
> > >
> > > Hi Erik,
> > > if you want to link against the static version of MFC, 
> you need to 
> > > rebuild the Xerces library using the "Debug Multithreaded" and
> > > "Multithreaded"
> > > setting (/MTd and /MT), instead of "Debug Multithreaded DLL" and
> > > "Multithreaded DLL" (/MDd and /MD)
> > >
> > > Alberto
> > >
> > > At 12.12 12/05/2004 +0200, Milan Tomic wrote:
> > > >Erik,
> > > >
> > > >         I did as you said but got some linker errors while
> > > trying to
> > > >use Xerces.lib in my projects:
> > > >
> > > >Linking...
> > > >MSVCRT.lib(MSVCR71.dll) : error LNK2005: _strncmp already defined
> in
> > > >libcmt.lib(strncmp.obj)
> > > >MSVCRT.lib(MSVCR71.dll) : error LNK2005: _isspace already defined
> in
> > > >libcmt.lib(_ctype.obj)
> > > >MSVCRT.lib(MSVCR71.dll) : error LNK2005: __errno already 
> defined in
> > > >libcmt.lib(dosmap.obj)
> > > >MSVCRT.lib(MSVCR71.dll) : error LNK2005: _exit already defined in
> > > >libcmt.lib(crt0dat.obj)
> > > >MSVCRT.lib(MSVCR71.dll) : error LNK2005: _atoi already defined in
> > > >libcmt.lib(atox.obj)
> > > >MSVCRT.lib(MSVCR71.dll) : error LNK2005: _strchr already 
> defined in
> > > >libcmt.lib(strchr.obj)
> > > >MSVCRT.lib(MSVCR71.dll) : error LNK2005: __itoa already 
> defined in
> > > >libcmt.lib(xtoa.obj)
> > > >MSVCRT.lib(MSVCR71.dll) : error LNK2005: _localeconv already
> > > defined in
> > > >libcmt.lib(lconv.obj)
> > > >MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __thiscall 
> > > >type_info::type_info(class type_info const &)"
> > > >(??0type_info@@AAE@ABV0@@Z) already defined in
> > > libcmt.lib(typinfo.obj)
> > > >MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: class 
> type_info
> &
> > > >__thiscall type_info::operator=(class type_info const &)"
> > > >(??4type_info@@AAEAAV0@ABV0@@Z) already defined in
> > > >libcmt.lib(typinfo.obj)
> > > >MSVCRT.lib(MSVCR71.dll) : error LNK2005: __stricmp 
> already defined
> in
> > > >libcmt.lib(stricmp.obj)
> > > >MSVCRT.lib(MSVCR71.dll) : error LNK2005: __strnicmp already
> > > defined in
> > > >libcmt.lib(strnicmp.obj)
> > > >LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with
> > > use of other
> > > >libs; use /NODEFAULTLIB:library Release/XercesTest.exe : fatal
> error
> > > >LNK1169: one or more multiply defined symbols found
> > > >
> > > >The reason for those errors is that I'm using MFC. When I
> > > link them as
> > > >shared lib, there are no errors, but I'd like to link 
> MFC as static 
> > > >lib. Are you using MFC? Is there a hope? Anyone?
> > > >
> > > >Thank you,
> > > >Milan
> > > >
> > > >
> > > > > -----Original Message-----
> > > > > From: Erik Rydgren [mailto:erik.rydgren@mandarinen.se]
> > > > > Sent: Tuesday, February 17, 2004 10:16 AM
> > > > > To: xerces-c-dev@xml.apache.org
> > > > > Subject: RE: Linking Xerces C++ statically
> > > > >
> > > > >
> > > > > We link Xerces statically with MS devstudio.
> > > > > How to do it:
> > > > >
> > > > > - First change the project type from dll to static lib.
> > > > > - Remove the Win32MsgLoader from the project and add the 
> > > > > InMemMsgLoader instead.
> > > > > - Change the project settings to define
> > > XML_USE_INMEM_MESSAGELOADER
> > > > > instead of USE_WIN32_MESSAGELOADER.
> > > > > - Change the defines for PLATFORM_EXPORT and 
> PLATFORM_IMPORT by 
> > > > > removing the _declspec(dllexport) and _declspec(dllimport)
> > > > > - Rebuild.
> > > > >
> > > > > Hope I didn't forget anything.
> > > > >
> > > > > Good luck
> > > > > Erik Rydgren
> > > > > Aptic AB
> > > > > Sweden
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Chaudhuri, Hiran 
> [mailto:Hiran.Chaudhuri@softwareag.com]
> > > > > > Sent: den 16 februari 2004 17:51
> > > > > > To: xerces-c-dev@xml.apache.org
> > > > > > Subject: Linking Xerces C++ statically
> > > > > >
> > > > > > Hi there.
> > > > > >
> > > > > > In the docs it is stated that Xerces C++ requires
> > > > > xerces-2.4.0.dll (on
> > > > > > Windows) to be distributed. Is it possible to have
> > > Xerces linked
> > > > > > statically so I do not need to distribute the DLL?
> > > > > >
> > > > > > Hiran
> > > > > >
> > > > > >
> > > > >
> > > 
> --------------------------------------------------------------------
> > > > > -
> > > > > > To unsubscribe, e-mail:
> xerces-c-dev-unsubscribe@xml.apache.org
> > > > > > For additional commands, e-mail:
> > > xerces-c-dev-help@xml.apache.org
> > > > >
> > > > >
> > > > >
> > > > >
> > > 
> --------------------------------------------------------------------
> > > > > -
> > > > > To unsubscribe, e-mail: 
> xerces-c-dev-unsubscribe@xml.apache.org
> > > > > For additional commands, e-mail:
> xerces-c-dev-help@xml.apache.org
> > > > >
> > > >
> > > >
> > > >
> > >
> >---------------------------------------------------------------------
> > > >To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> > > >For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
> > >
> > >
> > >
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> > > For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
> > >
> > 
> > 
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> > For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
> 

RE: Linking Xerces C++ statically

Posted by Erik Rydgren <er...@mandarinen.se>.
Yes we have done the same thing with Xalan. I can't remember the details
anymore but it is very similar to the Xerces conversion.

Good luck
/ Erik

> -----Original Message-----
> From: Milan Tomic [mailto:milan@setcce.org]
> Sent: den 12 maj 2004 16:13
> To: xerces-c-dev@xml.apache.org
> Subject: RE: Linking Xerces C++ statically
> 
> 
> Thank you. I've succeeded to link Xerces as static lib, but now I need
> to link Xalan as static lib, too. Have anyone succeded this using VC6
or
> VC7?
> 
> 
> 
> > -----Original Message-----
> > From: Alberto Massari [mailto:amassari@progress.com]
> > Sent: Wednesday, May 12, 2004 1:20 PM
> > To: xerces-c-dev@xml.apache.org
> > Subject: RE: Linking Xerces C++ statically
> >
> >
> > Hi Erik,
> > if you want to link against the static version of MFC, you
> > need to rebuild
> > the Xerces library using the "Debug Multithreaded" and
> > "Multithreaded"
> > setting (/MTd and /MT), instead of "Debug Multithreaded DLL" and
> > "Multithreaded DLL" (/MDd and /MD)
> >
> > Alberto
> >
> > At 12.12 12/05/2004 +0200, Milan Tomic wrote:
> > >Erik,
> > >
> > >         I did as you said but got some linker errors while
> > trying to
> > >use Xerces.lib in my projects:
> > >
> > >Linking...
> > >MSVCRT.lib(MSVCR71.dll) : error LNK2005: _strncmp already defined
in
> > >libcmt.lib(strncmp.obj)
> > >MSVCRT.lib(MSVCR71.dll) : error LNK2005: _isspace already defined
in
> > >libcmt.lib(_ctype.obj)
> > >MSVCRT.lib(MSVCR71.dll) : error LNK2005: __errno already defined in
> > >libcmt.lib(dosmap.obj)
> > >MSVCRT.lib(MSVCR71.dll) : error LNK2005: _exit already defined in
> > >libcmt.lib(crt0dat.obj)
> > >MSVCRT.lib(MSVCR71.dll) : error LNK2005: _atoi already defined in
> > >libcmt.lib(atox.obj)
> > >MSVCRT.lib(MSVCR71.dll) : error LNK2005: _strchr already defined in
> > >libcmt.lib(strchr.obj)
> > >MSVCRT.lib(MSVCR71.dll) : error LNK2005: __itoa already defined in
> > >libcmt.lib(xtoa.obj)
> > >MSVCRT.lib(MSVCR71.dll) : error LNK2005: _localeconv already
> > defined in
> > >libcmt.lib(lconv.obj)
> > >MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __thiscall
> > >type_info::type_info(class type_info const &)"
> > >(??0type_info@@AAE@ABV0@@Z) already defined in
> > libcmt.lib(typinfo.obj)
> > >MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: class type_info
&
> > >__thiscall type_info::operator=(class type_info const &)"
> > >(??4type_info@@AAEAAV0@ABV0@@Z) already defined in
> > >libcmt.lib(typinfo.obj)
> > >MSVCRT.lib(MSVCR71.dll) : error LNK2005: __stricmp already defined
in
> > >libcmt.lib(stricmp.obj)
> > >MSVCRT.lib(MSVCR71.dll) : error LNK2005: __strnicmp already
> > defined in
> > >libcmt.lib(strnicmp.obj)
> > >LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with
> > use of other
> > >libs; use /NODEFAULTLIB:library Release/XercesTest.exe : fatal
error
> > >LNK1169: one or more multiply defined symbols found
> > >
> > >The reason for those errors is that I'm using MFC. When I
> > link them as
> > >shared lib, there are no errors, but I'd like to link MFC as static
> > >lib. Are you using MFC? Is there a hope? Anyone?
> > >
> > >Thank you,
> > >Milan
> > >
> > >
> > > > -----Original Message-----
> > > > From: Erik Rydgren [mailto:erik.rydgren@mandarinen.se]
> > > > Sent: Tuesday, February 17, 2004 10:16 AM
> > > > To: xerces-c-dev@xml.apache.org
> > > > Subject: RE: Linking Xerces C++ statically
> > > >
> > > >
> > > > We link Xerces statically with MS devstudio.
> > > > How to do it:
> > > >
> > > > - First change the project type from dll to static lib.
> > > > - Remove the Win32MsgLoader from the project and add the
> > > > InMemMsgLoader instead.
> > > > - Change the project settings to define
> > XML_USE_INMEM_MESSAGELOADER
> > > > instead of USE_WIN32_MESSAGELOADER.
> > > > - Change the defines for PLATFORM_EXPORT and PLATFORM_IMPORT by
> > > > removing the _declspec(dllexport) and _declspec(dllimport)
> > > > - Rebuild.
> > > >
> > > > Hope I didn't forget anything.
> > > >
> > > > Good luck
> > > > Erik Rydgren
> > > > Aptic AB
> > > > Sweden
> > > >
> > > > > -----Original Message-----
> > > > > From: Chaudhuri, Hiran [mailto:Hiran.Chaudhuri@softwareag.com]
> > > > > Sent: den 16 februari 2004 17:51
> > > > > To: xerces-c-dev@xml.apache.org
> > > > > Subject: Linking Xerces C++ statically
> > > > >
> > > > > Hi there.
> > > > >
> > > > > In the docs it is stated that Xerces C++ requires
> > > > xerces-2.4.0.dll (on
> > > > > Windows) to be distributed. Is it possible to have
> > Xerces linked
> > > > > statically so I do not need to distribute the DLL?
> > > > >
> > > > > Hiran
> > > > >
> > > > >
> > > >
> > --------------------------------------------------------------------
> > > > -
> > > > > To unsubscribe, e-mail:
xerces-c-dev-unsubscribe@xml.apache.org
> > > > > For additional commands, e-mail:
> > xerces-c-dev-help@xml.apache.org
> > > >
> > > >
> > > >
> > > >
> > --------------------------------------------------------------------
> > > > -
> > > > To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> > > > For additional commands, e-mail:
xerces-c-dev-help@xml.apache.org
> > > >
> > >
> > >
> > >
> >
>---------------------------------------------------------------------
> > >To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> > >For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
> >
> >
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> > For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
> >
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


RE: Linking Xerces C++ statically

Posted by Milan Tomic <mi...@setcce.org>.
Thank you. I've succeeded to link Xerces as static lib, but now I need
to link Xalan as static lib, too. Have anyone succeded this using VC6 or
VC7?



> -----Original Message-----
> From: Alberto Massari [mailto:amassari@progress.com] 
> Sent: Wednesday, May 12, 2004 1:20 PM
> To: xerces-c-dev@xml.apache.org
> Subject: RE: Linking Xerces C++ statically
> 
> 
> Hi Erik,
> if you want to link against the static version of MFC, you 
> need to rebuild 
> the Xerces library using the "Debug Multithreaded" and 
> "Multithreaded" 
> setting (/MTd and /MT), instead of "Debug Multithreaded DLL" and 
> "Multithreaded DLL" (/MDd and /MD)
> 
> Alberto
> 
> At 12.12 12/05/2004 +0200, Milan Tomic wrote:
> >Erik,
> >
> >         I did as you said but got some linker errors while 
> trying to 
> >use Xerces.lib in my projects:
> >
> >Linking...
> >MSVCRT.lib(MSVCR71.dll) : error LNK2005: _strncmp already defined in
> >libcmt.lib(strncmp.obj)
> >MSVCRT.lib(MSVCR71.dll) : error LNK2005: _isspace already defined in
> >libcmt.lib(_ctype.obj)
> >MSVCRT.lib(MSVCR71.dll) : error LNK2005: __errno already defined in
> >libcmt.lib(dosmap.obj)
> >MSVCRT.lib(MSVCR71.dll) : error LNK2005: _exit already defined in
> >libcmt.lib(crt0dat.obj)
> >MSVCRT.lib(MSVCR71.dll) : error LNK2005: _atoi already defined in
> >libcmt.lib(atox.obj)
> >MSVCRT.lib(MSVCR71.dll) : error LNK2005: _strchr already defined in
> >libcmt.lib(strchr.obj)
> >MSVCRT.lib(MSVCR71.dll) : error LNK2005: __itoa already defined in
> >libcmt.lib(xtoa.obj)
> >MSVCRT.lib(MSVCR71.dll) : error LNK2005: _localeconv already 
> defined in
> >libcmt.lib(lconv.obj)
> >MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __thiscall 
> >type_info::type_info(class type_info const &)"
> >(??0type_info@@AAE@ABV0@@Z) already defined in 
> libcmt.lib(typinfo.obj)
> >MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: class type_info & 
> >__thiscall type_info::operator=(class type_info const &)"
> >(??4type_info@@AAEAAV0@ABV0@@Z) already defined in
> >libcmt.lib(typinfo.obj)
> >MSVCRT.lib(MSVCR71.dll) : error LNK2005: __stricmp already defined in
> >libcmt.lib(stricmp.obj)
> >MSVCRT.lib(MSVCR71.dll) : error LNK2005: __strnicmp already 
> defined in
> >libcmt.lib(strnicmp.obj)
> >LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with 
> use of other 
> >libs; use /NODEFAULTLIB:library Release/XercesTest.exe : fatal error 
> >LNK1169: one or more multiply defined symbols found
> >
> >The reason for those errors is that I'm using MFC. When I 
> link them as 
> >shared lib, there are no errors, but I'd like to link MFC as static 
> >lib. Are you using MFC? Is there a hope? Anyone?
> >
> >Thank you,
> >Milan
> >
> >
> > > -----Original Message-----
> > > From: Erik Rydgren [mailto:erik.rydgren@mandarinen.se]
> > > Sent: Tuesday, February 17, 2004 10:16 AM
> > > To: xerces-c-dev@xml.apache.org
> > > Subject: RE: Linking Xerces C++ statically
> > >
> > >
> > > We link Xerces statically with MS devstudio.
> > > How to do it:
> > >
> > > - First change the project type from dll to static lib.
> > > - Remove the Win32MsgLoader from the project and add the 
> > > InMemMsgLoader instead.
> > > - Change the project settings to define 
> XML_USE_INMEM_MESSAGELOADER 
> > > instead of USE_WIN32_MESSAGELOADER.
> > > - Change the defines for PLATFORM_EXPORT and PLATFORM_IMPORT by 
> > > removing the _declspec(dllexport) and _declspec(dllimport)
> > > - Rebuild.
> > >
> > > Hope I didn't forget anything.
> > >
> > > Good luck
> > > Erik Rydgren
> > > Aptic AB
> > > Sweden
> > >
> > > > -----Original Message-----
> > > > From: Chaudhuri, Hiran [mailto:Hiran.Chaudhuri@softwareag.com]
> > > > Sent: den 16 februari 2004 17:51
> > > > To: xerces-c-dev@xml.apache.org
> > > > Subject: Linking Xerces C++ statically
> > > >
> > > > Hi there.
> > > >
> > > > In the docs it is stated that Xerces C++ requires
> > > xerces-2.4.0.dll (on
> > > > Windows) to be distributed. Is it possible to have 
> Xerces linked 
> > > > statically so I do not need to distribute the DLL?
> > > >
> > > > Hiran
> > > >
> > > >
> > > 
> --------------------------------------------------------------------
> > > -
> > > > To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> > > > For additional commands, e-mail: 
> xerces-c-dev-help@xml.apache.org
> > >
> > >
> > >
> > > 
> --------------------------------------------------------------------
> > > -
> > > To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> > > For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
> > >
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> >For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


RE: Linking Xerces C++ statically

Posted by Alberto Massari <am...@progress.com>.
Hi Erik,
if you want to link against the static version of MFC, you need to rebuild 
the Xerces library using the "Debug Multithreaded" and "Multithreaded" 
setting (/MTd and /MT), instead of "Debug Multithreaded DLL" and 
"Multithreaded DLL" (/MDd and /MD)

Alberto

At 12.12 12/05/2004 +0200, Milan Tomic wrote:
>Erik,
>
>         I did as you said but got some linker errors while trying to use
>Xerces.lib in my projects:
>
>Linking...
>MSVCRT.lib(MSVCR71.dll) : error LNK2005: _strncmp already defined in
>libcmt.lib(strncmp.obj)
>MSVCRT.lib(MSVCR71.dll) : error LNK2005: _isspace already defined in
>libcmt.lib(_ctype.obj)
>MSVCRT.lib(MSVCR71.dll) : error LNK2005: __errno already defined in
>libcmt.lib(dosmap.obj)
>MSVCRT.lib(MSVCR71.dll) : error LNK2005: _exit already defined in
>libcmt.lib(crt0dat.obj)
>MSVCRT.lib(MSVCR71.dll) : error LNK2005: _atoi already defined in
>libcmt.lib(atox.obj)
>MSVCRT.lib(MSVCR71.dll) : error LNK2005: _strchr already defined in
>libcmt.lib(strchr.obj)
>MSVCRT.lib(MSVCR71.dll) : error LNK2005: __itoa already defined in
>libcmt.lib(xtoa.obj)
>MSVCRT.lib(MSVCR71.dll) : error LNK2005: _localeconv already defined in
>libcmt.lib(lconv.obj)
>MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __thiscall
>type_info::type_info(class type_info const &)"
>(??0type_info@@AAE@ABV0@@Z) already defined in libcmt.lib(typinfo.obj)
>MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: class type_info &
>__thiscall type_info::operator=(class type_info const &)"
>(??4type_info@@AAEAAV0@ABV0@@Z) already defined in
>libcmt.lib(typinfo.obj)
>MSVCRT.lib(MSVCR71.dll) : error LNK2005: __stricmp already defined in
>libcmt.lib(stricmp.obj)
>MSVCRT.lib(MSVCR71.dll) : error LNK2005: __strnicmp already defined in
>libcmt.lib(strnicmp.obj)
>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other
>libs; use /NODEFAULTLIB:library
>Release/XercesTest.exe : fatal error LNK1169: one or more multiply
>defined symbols found
>
>The reason for those errors is that I'm using MFC. When I link them as
>shared lib, there are no errors, but I'd like to link MFC as static lib.
>Are you using MFC? Is there a hope? Anyone?
>
>Thank you,
>Milan
>
>
> > -----Original Message-----
> > From: Erik Rydgren [mailto:erik.rydgren@mandarinen.se]
> > Sent: Tuesday, February 17, 2004 10:16 AM
> > To: xerces-c-dev@xml.apache.org
> > Subject: RE: Linking Xerces C++ statically
> >
> >
> > We link Xerces statically with MS devstudio.
> > How to do it:
> >
> > - First change the project type from dll to static lib.
> > - Remove the Win32MsgLoader from the project and add the
> > InMemMsgLoader instead.
> > - Change the project settings to define
> > XML_USE_INMEM_MESSAGELOADER instead of USE_WIN32_MESSAGELOADER.
> > - Change the defines for PLATFORM_EXPORT and PLATFORM_IMPORT
> > by removing the _declspec(dllexport) and _declspec(dllimport)
> > - Rebuild.
> >
> > Hope I didn't forget anything.
> >
> > Good luck
> > Erik Rydgren
> > Aptic AB
> > Sweden
> >
> > > -----Original Message-----
> > > From: Chaudhuri, Hiran [mailto:Hiran.Chaudhuri@softwareag.com]
> > > Sent: den 16 februari 2004 17:51
> > > To: xerces-c-dev@xml.apache.org
> > > Subject: Linking Xerces C++ statically
> > >
> > > Hi there.
> > >
> > > In the docs it is stated that Xerces C++ requires
> > xerces-2.4.0.dll (on
> > > Windows) to be distributed. Is it possible to have Xerces linked
> > > statically so I do not need to distribute the DLL?
> > >
> > > Hiran
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> > > For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> > For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
> >
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
>For additional commands, e-mail: xerces-c-dev-help@xml.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org