MFC extension DLL project with /clr option causes link error on _DllMain

I get link errors

mfcs80ud.lib(dllmodul.obj) : error LNK2005: __pRawDllMain already defined in DllMain.obj
mfcs80ud.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in DllMain.obj

The project options are

MFC extension DLL
/clr option (except the source file with my DllMain implementation)
UNICODE character set

[400 byte] By [JensK?hler] at [2007-12-17]
# 1
Hi,

Is this VS2003 or VS2005?

Thanks,
Nikola Dudar
VC++ Team

NikolaDudar at 2007-9-9 > top of Msdn Tech,Visual C++,Visual C++ Language...
# 2
VS 2005 Beta 2

The build type is Debug. Release works fine.

JensK?hler at 2007-9-9 > top of Msdn Tech,Visual C++,Visual C++ Language...
# 3
This looks like a bug in wizard generate code. If you are interested in tracking status of a fix for this issue, you are welcome to open a bug on http://lab.msdn.microsoft.com/productfeedback/default.aspx. Otherwise I will open a report for this issue internally.

Thanks,
Nikola

NikolaDudar at 2007-9-9 > top of Msdn Tech,Visual C++,Visual C++ Language...
# 4
Nikola,
I've been written a bug report.
Thanks for your help.
JensK?hler at 2007-9-9 > top of Msdn Tech,Visual C++,Visual C++ Language...
# 5
Thanks for submitting report. I have seen it already in the database. As you see in your entry this has been already fixed in the latest builds.

Thanks,
Nikola

NikolaDudar at 2007-9-9 > top of Msdn Tech,Visual C++,Visual C++ Language...
# 6
Nikola,

Is there a workaround for those of us who don't have
or can't use (I'm using WPF) a post Beta 2 Build ?

Cheers

Fab101 at 2007-9-9 > top of Msdn Tech,Visual C++,Visual C++ Language...
# 7
I ran into the same problem. Do you know of nay workaround, since I am bound to use vs 2005 beta 2 for quite some time since I need to use the winfsdk wich only works with beta 2 of Visual Stusio 2005.
bitbonk at 2007-9-9 > top of Msdn Tech,Visual C++,Visual C++ Language...
# 8
Unfortunately I cannot think of a simple workaround to this problem. Please update VS to RC or release version when it is available.
NikolaDudar at 2007-9-9 > top of Msdn Tech,Visual C++,Visual C++ Language...
# 9
I am using VS 2005 Std Ed.

and after building a couple of times started getting the following error:
Error 2 error LNK2005: _DllMain@12 already defined in MSVCRTD.lib(dllmain.obj) mfcs80ud.lib

Which seems related to earlier in this thread as a bug in beta. However, I don't think I have the beta code set. I am on:
Version 8.0.50727.42 (RTM.050727-4200)

Please advise.

JoshGammon at 2007-9-9 > top of Msdn Tech,Visual C++,Visual C++ Language...