错误LNK2005:_DllMain @ 12已在MSVCRT.lib中定义 [英] error LNK2005: _DllMain@12 already defined in MSVCRT.lib
问题描述
我收到此链接器错误。
mfcs80.lib(dllmodul.obj):error LNK2005:_DllMain @ 12已在MSVCRT.lib(dllmain.obj)中定义
请告诉我正确的消除此错误的方法。我在微软支持网站上阅读关于这个bug的解决方案,但它没有帮助太多。
Please tell me the correct way of eliminating this bug. I read solution on microsoft support site about this bug but it didnt helped much.
我使用VS 2005和Platform SDK
I am using VS 2005 with Platform SDK
推荐答案
如果你仔细阅读链接器错误,并应用一些知识,你可能会自己:
If you read the linker error thoroughly, and apply some knowledge, you may get there yourself:
链接器
每个对象/库描述
- 它预期在其他对象中出现的符号
- 它定义的符号
如果两个对象定义了相同的符号,则会得到此链接器错误。在你的case,mfcs80.lib和MSVCRT.lib定义_DllMain @ 12符号。
If two objects define the same symbol, you get exactly this linker error. In your case, both mfcs80.lib and MSVCRT.lib define the _DllMain@12 symbol.
摆脱错误:
- 找到你实际需要的两个库
- 找到如何告诉链接器不要使用另一个a href =http://stackoverflow.com/questions/343368/error-lnk2005-dllmain12-already-defined-in-msvcrtlib#343413>来自James Hopkin的提示)
- find out which of both libraries you actually need
- find out how to tell the linker not to use the other one (using e.g. the tip from James Hopkin)
这篇关于错误LNK2005:_DllMain @ 12已在MSVCRT.lib中定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!