Recommended Posts

I have an executable that is being linked with a static library. Some times it links fine and sometimes it gives the following error. I'm really confused about why its happening. It seems to happen at odd intervals. Both the executable and static library are being compiled as multi threaded. The executable is linked with a Static MFC library. I'm not sure if its because of something I changed or not. I did a search on google and found nothing on this error. Any suggestions? Thanks. Bill
--------------------Configuration: LevelED - Win32 Release--------------------
nafxcw.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) already defined in LIBCMT.lib(new.obj)
nafxcw.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) already defined in libcpmt.lib(delop.obj)
../Release/LevelED.exe : fatal error LNK1169: one or more multiply defined symbols found

LevelED.exe - 3 error(s), 0 warning(s)


Share on other sites
Oddly enough, adding 'nafxcw.lib' to the Object/Library section under the Linker tab for the executable resolved the issue. I'm still puzzled by this?

Bill

Create an account

Register a new account

• Forum Statistics

• Total Topics
628274
• Total Posts
2981740

• 10
• 11
• 17
• 10
• 9