Hi Matt,
to remove the "operator new" error you should remove this block

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

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)


Alberto


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

Hello!

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)" ([EMAIL PROTECTED]@Z) already defined in
nafxcwd.lib(afxmem.obj)

(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
signature.

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))?

Thanks!
Matt


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to