Lnk 2005 error in release only
When building my dll in release mode using VS2005 I get this linker error for mfcs80u.lib:
error LNK2005: _DllMain@12 already defined in msvcrt.lib(dllmain.obj)
Strangely, it builds fine in debug mode.
I've googled it and found this: http://support.microsoft.com/kb/148652
As described, I tried ignoring the two libraries (msvcrt.lib and mfcs80u.lib) and adding them as dependencies (with the mfcs80u.lib listed first) but to no avail.
I've also tried including Afx.h in each file and I wasn't using precomplied headers so I'm a bit stuck.
My dll is setup as using MFC in a shared dll and the runtime library is Multi-threaded dll.
Has anyone any ideas how I can solve this?