xerces-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alberto Massari <amass...@progress.com>
Subject Re: Static xerces lib on Win32
Date Mon, 01 Nov 2004 13:31:08 GMT
Hi Matt,
to remove the "operator new" error you should remove this block

#ifdef _DEBUG
  #ifdef _MSC_VER
     #include <crtdbg.h>
     #include <assert.h>

from Win32PlatformUtils.cpp.
You should also change the code generation options to use the static 
version of the C runtime (/MT and /MTd instead of /MD and MDd)


At 07.48 27/10/2004 -0700, Matt Garman wrote:

>I'm trying to link in a static xerces library on Win32 under MS Visual
>Studio 7.1.  I downloaded and unzipped the 2.6.0 source.  I changed
>the build type to static library (in the xerces project settings).  I
>also went into the VCPPDefs.hpp and redefined PLATFORM_EXPORT and
>PLATFORM_IMPORT as nothing (i.e. ``#define PLATFORM_EXPORT'').
>Anyway, when linking the resultant library with my application, I get
>the following error:
>XercesLib_d.lib(Win32PlatformUtils.obj) : error LNK2005: "void *
>__cdecl operator new(unsigned int)" (??2@YAPAXI@Z) already defined in
>(Note: I renamed the library from XercesLib.lib to XercesLib_d.lib.)
>I can't seem to find where operator new() is defined with that
>Note that I was also having the same linker error with a reference to
>DLLMain(); I found that function in Win32MsgLoader.cpp, commented it
>out, and rebuilt the library.
>Does anyone know where that operator new() the linker is complaining
>about is defined?  Also, is there a more elegant way to prevent these
>functions from being defined (such as defining a certain symbol or
>changing some setting (as opposed to hacking the code))?
>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

View raw message