By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,134 Members | 1,796 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,134 IT Pros & Developers. It's quick & easy.

LNK2005-error in Visual C++ v. 6.0

P: n/a
Jon
Hi!
I have a problem that have followed me for a long time.
When linking, sometimes this link error below arises. My solution is
always to remove all files in the project, throw away all debug-files
(.obj), rebuild, insert all files in the project and rebuild. After that
procedure, the linker usually proceed.
But not this time. So I decided to try and find the real problem, but
failed. So here I am.

When Linking in debug-mode, this error below comes up. When linking in
release-mode, everything works fine. So, according to helpfiles, this is
some mix-up with debug and release libraries. Just that I can't figure it
out by myself.

I hope someone can help me solve this!

The errormessage:
--------------------Configuration: SH03 - Win32 Debug--------------------
Linking...
nafxcwd.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator
new(unsigned int)" (??2@YAPAXI@Z) already defined in LIBCD.lib(new.obj)
nafxcwd.lib(afxmem.obj) : error LNK2005: "void __cdecl operator
delete(void *)" (??3@YAXPAX@Z) already defined in LIBCD.lib(dbgdel.obj)
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol
__endthreadex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol
__beginthreadex
Debug/SH03.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.

SH03.exe - 5 error(s), 0 warning(s)

Here are the libraries that I include in the project:
dxguid.lib dsound.lib ddraw.lib dinput.lib winmm.lib comctl32.lib
msacm32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib
odbccp32.lib
Thank's for any help!
Jon Lennryd
Jul 22 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Jon wrote:
I have a problem that have followed me for a long time.
When linking, sometimes this link error below arises. My solution is
always to remove all files in the project, throw away all debug-files
(.obj), rebuild, insert all files in the project and rebuild. After that
procedure, the linker usually proceed.
But not this time. So I decided to try and find the real problem, but
failed. So here I am.
[...]


Yes, here you are, in comp.lang.c++ where link errors are usually OT and
where product-specific solutions are definitely OT. Perhaps you will see
the light and find the right newsgroup. Hint: "microsoft.public.vc.*".
Jul 22 '05 #2

P: n/a
Jon wrote:
I hope someone can help me solve this!

The errormessage:
------------Configuration: SH03 - Win32 Debug--------------------
Linking...
nafxcwd.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator
new(unsigned int)" (??2@YAPAXI@Z) already defined in
LIBCD.lib(new.obj)
nafxcwd.lib(afxmem.obj) : error LNK2005: "void __cdecl operator
delete(void *)" (??3@YAXPAX@Z) already defined in
LIBCD.lib(dbgdel.obj)
These messages usually occur if you mix and match the different run
time libraries. The MSVC++ offers single threaded, multi threaded,
multi threaded dll version of the run time libraries in both debug
and release and if you do not use the same RTL for all the libraries
and objects that make up the executable or dll, you get this warning.
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol
__endthreadex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol
__beginthreadex
Debug/SH03.exe : fatal error LNK1120: 2 unresolved externals


In a similar mannaer, I think this warning message disapears if you
make sure all files are compiled to use the multi threaded or multi
threaded dll RTL.

Jussi Jumppanen
Author of: Zeus for Windows (New version 3.93 out now)
"The C/C++, Cobol, Java, HTML, Python, PHP, Perl programmer's editor"
Home Page: http://www.zeusedit.com
Jul 22 '05 #3

P: n/a
Jon
Victor Bazarov <v.********@comAcast.net> wrote in
news:RH**************@newsread1.dllstx09.us.to.ver io.net:
Jon wrote:
I have a problem that have followed me for a long time.
[...]


Yes, here you are, in comp.lang.c++ where link errors are usually OT
and where product-specific solutions are definitely OT. Perhaps you
will see the light and find the right newsgroup. Hint:
"microsoft.public.vc.*".


Yep, you're right, it's quite product-specific, thank's for the hint.

Jul 22 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.