Theurgist
asked on
Link errors
We're frequently running into these linkage errors and haven't been able to track the problem down. If anyone else has run into this and solved it, we'd sure like to know. A couple of us here have already checked the obvious....all our libraries are compiled multi-threaded. The project links fine under RELEASE, but fails under DEBUG.
Linking...
nafxcwd.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned int)"(??2@YAPAXI@Z) already defined in LIBCMTD.lib(new.obj)
nafxcwd.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete(void *)"(??3@YAXPAX@Z) already defined in LIBCMTD.lib(dbgdel.obj)
LINK : warning LNK4098: defaultlib "LIBCMT" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "nafxcw.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
Sometimes, we're able to delete the project files and rebuild them from scratch and that will fix it. We've done compares on the .MAK files and haven't seen anything significantly different.
Debug Compiler Flags: /nologo /MTd /W3 /Gm /GX /Zi /Od /I "." /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "OS_NO_MIN_MAX" /D "OS_NO_AUTO_INSTANTIATE" /D "HAS_WIN32_THREADS" /Fo"Debug/" /Fd"Debug/" /c
Debug Link Flags: ot42d.lib esql.lib eldorado.lib skycon.lib ospace.lib caw32.lib sqlakw32.lib /nologo /subsystem:windows /incremental:yes /pdb:"Debug/AdInsert.pdb" /debug /machine:I386 /out:"Debug/AdInsert.exe"
Release Compiler Flags: /nologo /MT /W3 /GX /O2 /I "." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "OS_NO_MIN_MAX" /D "OS_NO_AUTO_INSTANTIATE" /D "HAS_WIN32_THREADS" /Fo"Release/" /c
Release Link Flags: ot42r.lib esql.lib eldorado.lib skycon.lib ospace.lib caw32.lib sqlakw32.lib /nologo /subsystem:windows /incremental:no /pdb:"Release/AdInsert.pdb " /machine:I386 /out:"Release/AdInsert.exe "
Linking...
nafxcwd.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned int)"(??2@YAPAXI@Z) already defined in LIBCMTD.lib(new.obj)
nafxcwd.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete(void *)"(??3@YAXPAX@Z) already defined in LIBCMTD.lib(dbgdel.obj)
LINK : warning LNK4098: defaultlib "LIBCMT" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "nafxcw.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
Sometimes, we're able to delete the project files and rebuild them from scratch and that will fix it. We've done compares on the .MAK files and haven't seen anything significantly different.
Debug Compiler Flags: /nologo /MTd /W3 /Gm /GX /Zi /Od /I "." /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "OS_NO_MIN_MAX" /D "OS_NO_AUTO_INSTANTIATE" /D "HAS_WIN32_THREADS" /Fo"Debug/" /Fd"Debug/" /c
Debug Link Flags: ot42d.lib esql.lib eldorado.lib skycon.lib ospace.lib caw32.lib sqlakw32.lib /nologo /subsystem:windows /incremental:yes /pdb:"Debug/AdInsert.pdb" /debug /machine:I386 /out:"Debug/AdInsert.exe"
Release Compiler Flags: /nologo /MT /W3 /GX /O2 /I "." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "OS_NO_MIN_MAX" /D "OS_NO_AUTO_INSTANTIATE" /D "HAS_WIN32_THREADS" /Fo"Release/" /c
Release Link Flags: ot42r.lib esql.lib eldorado.lib skycon.lib ospace.lib caw32.lib sqlakw32.lib /nologo /subsystem:windows /incremental:no /pdb:"Release/AdInsert.pdb
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.