由于已定义而导致的链接器错误

发布于 2024-11-25 14:06:07 字数 897 浏览 0 评论 0原文

自从我编写任何使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

醉生梦死 2024-12-02 14:06:07

问题是我的 .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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文