1

当我将以下行添加到我的代码中时:

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.h, time.h, string.

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

4

1 回答 1

1

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

谢谢尼拉吉·拉蒂

于 2013-03-27T12:11:45.873 回答