error LNK2005: _DllMain@12 already defined in MSVCRT.lib(错误 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.
摆脱错误:
- 找出您真正需要的两个库中的哪一个
- 找出如何告诉链接器不要使用另一个(例如使用 詹姆斯·霍普金 (James Hopkin) 的提示)
这篇关于错误 LNK2005:_DllMain@12 已在 MSVCRT.lib 中定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:错误 LNK2005:_DllMain@12 已在 MSVCRT.lib 中定义


基础教程推荐
- 如何通过C程序打开命令提示符Cmd 2022-12-09
- 这个宏可以转换成函数吗? 2022-01-01
- 我有静态或动态 boost 库吗? 2021-01-01
- 静态库、静态链接动态库和动态链接动态库的 .lib 文件里面是什么? 2021-01-01
- 如何将 std::pair 的排序 std::list 转换为 std::map 2022-01-01
- C++结构和函数声明。为什么它不能编译? 2022-11-07
- 如何在 C++ 中初始化静态常量成员? 2022-01-01
- 常量变量在标题中不起作用 2021-01-01
- 如何检查GTK+3.0中的小部件类型? 2022-11-30
- 在 C++ 中计算滚动/移动平均值 2021-01-01