错误 LNK2005:_DllMain@12 已在 MSVCRT.lib 中定义 [英] error LNK2005: _DllMain@12 already defined in MSVCRT.lib

查看:32
本文介绍了错误 LNK2005:_DllMain@12 已在 MSVCRT.lib 中定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到此链接器错误.

mfcs80.lib(dllmodul.obj) : error LNK2005: _DllMain@12 已在 MSVCRT.lib(dllmain.obj) 中定义

请告诉我消除此错误的正确方法.我在微软支持网站上阅读了有关此错误的解决方案,但并没有太大帮助.

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:

链接器将许多已编译的对象和库链接在一起以获得二进制文件.

The linker links a number of compiled objects and libraries together to get a binary.

每个对象/库描述

  • 它期望在其他对象中出现什么符号
  • 它定义了什么符号

如果两个对象定义了相同的符号,你就会得到这个链接器错误.在您的情况下, 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.

摆脱错误:

  1. 找出您真正需要的两个库中的哪一个
  2. 找出如何告诉链接器不要使用另一个(例如使用 詹姆斯·霍普金 (James Hopkin) 的提示)

这篇关于错误 LNK2005:_DllMain@12 已在 MSVCRT.lib 中定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆