-
April 25th, 2011, 10:23 PM
#1
Link Error _DllMain@12 already defined
Here's the situation:
I have a VS 2005 project and 'Use of MFC' is set as [Use Windows Standard Libraries]. This project generates a DLL
When compiling, I am getting the following link errors
Code:
1>uafxcwd.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in MyDLL.obj
1>uafxcwd.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) already defined in LIBCMTD.lib(new.obj)
1>uafxcwd.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) already defined in LIBCMTD.lib(dbgdel.obj)
1>uafxcwd.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new[](unsigned int)" (??_U@YAPAXI@Z) already defined in libcpmtd.lib(newaop.obj)
1>uafxcwd.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete[](void *)" (??_V@YAXPAX@Z) already defined in LIBCMTD.lib(delete2.obj)
I don't understand why the project is linking with uafxcwd.lib
Any idea?
-
April 26th, 2011, 09:42 AM
#2
Re: Link Error _DllMain@12 already defined
Victor Nijegorodov
-
April 26th, 2011, 07:42 PM
#3
Re: Link Error _DllMain@12 already defined
I've been to that link already and tried the fixes but the following error still exists
Code:
1>uafxcwd.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in MyDLL.obj
What puzzles me here is that, my DLL is set as a Standard Windows Library (non MFC), it should not link to uafxcwd.lib (an MFC library).. am I correct?
-
April 27th, 2011, 12:21 PM
#4
Re: Link Error _DllMain@12 already defined
It depends on actual code inclusions. In case some part of your code "touches" MFC stuff, you just cannot avoid the dependency. And make sure your project has no "AFX" defines.
Best regards,
Igor
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|