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

 



Answer this question

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

  • thedigitalpioneer

    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.


  • Bloody Beginner

    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

  • Kusuma

    VS 2005 Beta 2

    The build type is Debug. Release works fine.

  • yonis

    Nikola,
    I've been written a bug report.
    Thanks for your help.

  • AKOUL

    Hi,

    Is this VS2003 or VS2005

    Thanks,
    Nikola Dudar
    VC++ Team

  • cfd33

    Unfortunately I cannot think of a simple workaround to this problem. Please update VS to RC or release version when it is available.

  • david22

    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

  • Adel Hazzah

    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.

  • annefa

    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

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