error LNK2005: _DllMain@12 already defined in MSVCRT.lib

前端 未结 17 2049
臣服心动
臣服心动 2020-12-14 06:44

I am getting this linker error.

mfcs80.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in MSVCRT.lib(dllmain.obj)

17条回答
  •  一向
    一向 (楼主)
    2020-12-14 06:55

    There is a common theme running through some of the answers here.

    Avishek Bose:-

    Declare the mfc80ud.lib and mfcs80ud.lib in the Additional Dependancies field in the Project Properties -> Linker Tab -> Input of Visual Studio to fix the issue.

    vmb100:-

    I am working with Visual Studio 2010, so in my case the MFC lib is called mfc100.lib.

    joseAndresGomezTovar:-

    I have a very similar problem. [mfcs110d.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in MSVCRTD.lib(dllmain.obj)] and the solution was add mfcs110d.lib to Additional Dependencies

    So the general case seems to be to first find the name of the library to add ...

    and then to add it ....

    Note that there seem to be some prerequisites and/or alternative solutions.

提交回复
热议问题