Q

Question

LNK2005 error

Another link error:

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)
.\Debug\foo.exe : fatal error LNK1169: one or more multiply defined symbols found

So LIBCMTD.lib is a standard C runtime library, multithreaded and Nafxcwd.lib is afx, debug version

I have the /MTd option in Project Setting -> C/C++

Suggested solutions to this problem that I've seen elsewhere on the net involve changing options on the Project Settings "Link" tab, which I have do not have

Using VC++6

201409-LO-Qu-017

Get Smarter with
Microsoft Development


46,497

Answers


2,500+

Articles & Videos


25,103

Contributors

Ask the Microsoft Development Experts Your Question

Sign Up to Ask

Cancel anytime

What does a Premium Membership get you?

  • Unlimited Access to over 4 million verified technology solutions

  • Unlimited Access to thousands of interactive articles and videos

  • Unlimited technical writing assistance

  • Submit your projects for Expert Testing

  • Expand your professional network with our messaging and hire me features

  • Ad free and mobile optimized experience

Join the Network Today!

See Plans and Pricing