
Please Help! - Link Error LNK2005
Hi Kotpal,
Thanks for the advice but I had tried this before. If I ignore either
libcmt.lib or nafxcw.lib, I get tons of "error LNK2001: unresolved
external symbol" errors. This can't be the right approach.
I've gone to Help | search tab and typed "lnk2005". It provides the
below help but I'm not sure what I would need to change.
-David Faltermier
==========================================
Linker Tools Error LNK2005: symbol already defined in object
The given symbol, displayed in its decorated form, was multiply defined.
One of the following may be a cause:
1. The most common cause of this error is accidentally linking with both
the single-threaded and multithreaded libraries. Ensure that the
application project file includes only the appropriate libraries and
that any third-party libraries have appropriately created
single-threaded or multithreaded versions.
2. The given symbol was a packaged function (created by compiling with
/Gy) and was included in more than one file but was changed between
compilations. Recompile all files that include the symbol.
3. The given symbol was defined differently in two member objects in
different libraries, and both member objects were used.
4. An absolute was defined twice, with a different value in each
definition.
=================================================
Quote:
> Goto Project Settings | Link tab | Category "Input" Ignore
> Libraries: libcmt.lib Let me know if this worked... -Krishna 'Kotpal'
> I am using Visual C++ v6.0 (with Visual Studio SP3 on WinNT
> 4 SP5) and cannot resolve a link error when compiling a
> Window's app.
> The error appears to reflect a conflict between the MFC and
> C++ libraries. However, I am at a loss on how to solve it.
> Can anyone offer some help? The build error is shown below.
> Thanks,
> David Faltermier
> ========
> Linking...
> nafxcw.lib(afxmem.obj) : error LNK2005: "void * __cdecl
> in LIBCMT.lib(new.obj)
> nafxcw.lib(afxmem.obj) : error LNK2005: "void __cdecl
> LIBCMT.lib(delete.obj)
> .\Release/DOA.exe : fatal error LNK1169: one or more
> multiply defined symbols found
> Error executing link.exe.
> DOA.exe - 3 error(s), 0 warning(s)
> ========