简体   繁体   English

Linker 由于已经定义的错误

[英]Linker Errors due to being Already Defined

It has been about a year since I wrote any.dll plugins that use LibCurl, but I decided to start on another one tonight.自从我写任何使用 LibCurl 的 dll 插件以来已经过去了大约一年,但我决定今晚再开始一个。 Unfortunately, I have been combating the same linker errors for almost 4 hours now, and I am completely lost.不幸的是,我已经与同样的 linker 错误作斗争了将近 4 个小时,我完全迷失了。

I am statically building LibCurl, and it appears to be fine for the most part, except I am getting the following linker errors.我正在静态构建 LibCurl,它似乎在大多数情况下都很好,除了我收到以下 linker 错误。

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. 1) 由于 MSDN 说 LNK2005 是由此引起的,因此重新组织了我包含的库。

2) Rebuilding the LibCurl lib through MSVC Application, then through the Command-Line tool. 2) 通过 MSVC 应用程序重建 LibCurl 库,然后通过命令行工具。

3) Excluding the libs that are causing issues. 3) 排除引起问题的库。

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?谁能帮我提供一些关于如何解决这些问题的信息?

Problem was my.dll was /MT while the libcurl was /MD.问题是 my.dll 是 /MT 而 libcurl 是 /MD。 Also, I had initially blocked "libcmt", so when I was switching libcurl to /MT, it was spewing errors.另外,我最初阻止了“libcmt”,所以当我将 libcurl 切换到 /MT 时,它正在喷出错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM