由于已定义而导致的链接器错误
自从我编写任何使用 LibCurl 的 .dll 插件以来已经大约一年了,但我决定今晚开始编写另一个插件。不幸的是,我已经与相同的链接器错误作斗争近 4 个小时了,我完全迷失了。
我正在静态构建 LibCurl,除了出现以下链接器错误之外,它在大多数情况下似乎都很好。
1>MSVCRT.lib(MSVCR90.dll) : error LNK2005: _calloc already defined in memoverride.obj
1>MSVCRT.lib(MSVCR90.dll) : error LNK2005: _realloc already defined in memoverride.obj
1>MSVCRT.lib(MSVCR90.dll) : error LNK2005: _free already defined in memoverride.obj
1>MSVCRT.lib(MSVCR90.dll) : error LNK2005: _malloc already defined in memoverride.obj
1>MSVCRT.lib(MSVCR90.dll) : error LNK2005: __strdup already defined in memoverride.obj
1>MSVCRT.lib(MSVCR90.dll) : error LNK2005: __malloc_crt already defined in memoverride.obj
我已经尝试过...
1) 重新组织我包含的库,因为 MSDN 说 LNK2005 是由此引起的。
2) 通过 MSVC 应用程序重建 LibCurl 库,然后通过命令行工具。
3) 排除引起问题的库。
还有很多我现在都不记得的事情了。谁能帮我提供一些有关如何解决这些问题的信息?
It has been about a year since I wrote any .dll plugins that use LibCurl, but I decided to start on another one tonight. Unfortunately, I have been combating the same linker errors for almost 4 hours now, and I am completely lost.
I am statically building LibCurl, and it appears to be fine for the most part, except I am getting the following linker errors.
1>MSVCRT.lib(MSVCR90.dll) : error LNK2005: _calloc already defined in memoverride.obj
1>MSVCRT.lib(MSVCR90.dll) : error LNK2005: _realloc already defined in memoverride.obj
1>MSVCRT.lib(MSVCR90.dll) : error LNK2005: _free already defined in memoverride.obj
1>MSVCRT.lib(MSVCR90.dll) : error LNK2005: _malloc already defined in memoverride.obj
1>MSVCRT.lib(MSVCR90.dll) : error LNK2005: __strdup already defined in memoverride.obj
1>MSVCRT.lib(MSVCR90.dll) : error LNK2005: __malloc_crt already defined in memoverride.obj
I have tried...
1) Reorganizing my included libs due to MSDN saying LNK2005 was caused by this.
2) Rebuilding the LibCurl lib through MSVC Application, then through the Command-Line tool.
3) Excluding the libs that are causing issues.
and a bunch of other things that I cannot even remember now. Can anyone help me out with some information as to how I can solve these?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题是我的 .dll 是 /MT,而 libcurl 是 /MD。另外,我最初阻止了“libcmt”,因此当我将 libcurl 切换到 /MT 时,它会喷出错误。
Problem was my .dll was /MT while the libcurl was /MD. Also, I had initially blocked "libcmt", so when I was switching libcurl to /MT, it was spewing errors.