Linker error "new" symbol multiple definitions

I am getting linker errors like this one...
Code:
1>box2d.lib(b2World.obj) : warning LNK4006: "void * __cdecl operator new(unsigned int,void *)" (??2@YAPAXIPAX@Z) already defined in winMemory.obj; second definition ignored

And also the same for ... b2Shape.obj, b2Joint.obj, b2PolyContact.obj, b2CircleContact.obj, and b2PolyAndCircleContact.obj.

Looking at the respective headers, these appear to be the files that have "#include <new>".

It appears that this is conflicting with another definition of new that is used elsewhere in the engine I am using. Since I am unable to track down and remove that, perhaps there is a way to fix this on the b2d side?

This linker error occurs when I include the required headers for my engine and box2d.h in a source file and I then try to allocate something.

Here is an example of how b2d seems to allocate things...
Code:
void* mem = b2Alloc(sizeof(b2BroadPhase));
m_broadPhase = new (mem) b2BroadPhase(worldAABB, &m_contactManager);


Is there a way to get rid of this multi-definition without breaking the way b2-allocates stuff, or at least with minimal changes to it?
Box2D includes new.h in order to do placement new. You might have trouble if you overload new globally.
well, I'm getting these link errors...

Code:
1>------ Build started: Project: test_app, Configuration: Release Win32 ------
1>Linking...
1>LIBCMTD.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in MSVCRT.lib(MSVCR80.dll)
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: _malloc already defined in MSVCRT.lib(MSVCR80.dll)
1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: _free already defined in MSVCRT.lib(MSVCR80.dll)
1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: _exit already defined in MSVCRT.lib(MSVCR80.dll)
1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: __exit already defined in MSVCRT.lib(MSVCR80.dll)
1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: __cexit already defined in MSVCRT.lib(MSVCR80.dll)
1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: __amsg_exit already defined in MSVCRT.lib(MSVCR80.dll)
1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: __initterm_e already defined in MSVCRT.lib(MSVCR80.dll)
1>LIBCMTD.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined in MSVCRT.lib(MSVCR80.dll)
1>LIBCMTD.lib(tidtable.obj) : error LNK2005: __encode_pointer already defined in MSVCRT.lib(MSVCR80.dll)
1>LIBCMTD.lib(tidtable.obj) : error LNK2005: __decode_pointer already defined in MSVCRT.lib(MSVCR80.dll)
1>LIBCMTD.lib(errmode.obj) : error LNK2005: ___set_app_type already defined in MSVCRT.lib(MSVCR80.dll)
1>LIBCMTD.lib(dbghook.obj) : error LNK2005: __crt_debugger_hook already defined in MSVCRT.lib(MSVCR80.dll)
1>LIBCMTD.lib(setlocal.obj) : error LNK2005: __configthreadlocale already defined in MSVCRT.lib(MSVCR80.dll)
1>LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in MSVCRT.lib(cinitexe.obj)
1>LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in MSVCRT.lib(cinitexe.obj)
1>LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in MSVCRT.lib(cinitexe.obj)
1>LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in MSVCRT.lib(cinitexe.obj)
1>LIBCMTD.lib(hooks.obj) : error LNK2005: "void __cdecl terminate(void)" (?terminate@@YAXXZ) already defined in MSVCRT.lib(MSVCR80.dll)
1>LIBCMTD.lib(mlock.obj) : error LNK2005: __lock already defined in MSVCRT.lib(MSVCR80.dll)
1>LIBCMTD.lib(mlock.obj) : error LNK2005: __unlock already defined in MSVCRT.lib(MSVCR80.dll)
1>LIBCMTD.lib(ismbbyte.obj) : error LNK2005: __ismbblead already defined in MSVCRT.lib(MSVCR80.dll)
1>LIBCMTD.lib(exsup.obj) : error LNK2005: __except_list already defined in MSVCRT.lib(dllsupp.obj)
1>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 LIBCMTD.lib(typinfo.obj)
1>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 LIBCMTD.lib(typinfo.obj)
1>MSVCRT.lib(MSVCR80.dll) : error LNK2005: _isspace already defined in LIBCMTD.lib(_ctype.obj)
1>MSVCRT.lib(MSVCR80.dll) : error LNK2005: ___iob_func already defined in LIBCMTD.lib(_file.obj)
1>MSVCRT.lib(MSVCR80.dll) : error LNK2005: _fclose already defined in LIBCMTD.lib(fclose.obj)
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library
1>E:\WORK\SDL\Projects\test_app\Release\test_app.exe : fatal error LNK1169: one or more multiply defined symbols found
1>Build log was saved at "file://e:\WORK\SDL\Projects\test_app\Release\BuildLog.htm"
1>test_app - 29 error(s), 2 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


and I just created the world....any ideas?
ah, forget it...i've rewritten the program and it works now....though this was odd....
It looks like you had inconsistent build options. Some code was building multithreading/DLL and others were not.
dunno...it worked perfectly just a moment before...who knows?....anyway, it works:D I was linking it up with SDL....any idea on how to transfer the rotation to the sdl surface?:D the gfx rotozoom part doesn't work and with OGL.....no way... ideas?:D any way the engine rocks;) gg;)

Original thread: https://box2d.org/forum/viewtopic.php?t=946