cpp中的奇怪链接器错误

时间:2013-03-27 11:37:45

标签: c++ windows linker-errors

当我在代码中添加以下行时:

std::string sFrameTag

我收到以下链接器错误:

Error   34  error LNK2005: "public: __thiscall std::basic_string<char,struct 
std::char_traits<char>,class std::allocator<char> >::~basic_string<char,struct 
std::char_traits<char>,class std::allocator<char> >(void)" (??1?$basic_string@DU?
$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already defined in 
VFPAnalyzerApi.lib(VFPEvaluation.obj)   msvcprtd.lib

我确定sFrameTag只定义了一次,我尝试使用其他名称来确定这个变量。我有以下内容:stdio.htime.hstring

有人可以指导一下导致此错误的原因吗?

1 个答案:

答案 0 :(得分:1)

当我试图静态地包含所有需要的运行时库时,我也会遇到类似的错误。当您尝试导入与/ MD选项静态链接的库时,请检查是否还需要使用/ MD。

由于 Niraj Rathi

相关问题