在VS 2010中构建lib以在VS 2005中使用?

时间:2011-12-09 13:55:07

标签: visual-studio-2010 visual-studio-2005 shared-libraries

我需要在VS 2005中使用WebRTC。据我所知,我需要VS 2005 SP1才能达到此目的。否则,始终会出现两个链接错误:

LIBCMTD.lib(stdexcpt.obj) : error LNK2005: "public: virtual __thiscall std::exception::~exception(void)" (??1exception@std@@UAE@XZ) already defined in SwitchingSampRate.obj
LIBCMTD.lib(stdexcpt.obj) : error LNK2005: "public: virtual char const * __thiscall std::exception::what(void)const" (?what@exception@std@@UBEPBDXZ) already defined in SwitchingSampRate.obj

我出于某种原因无法安装SP1。因此,为了避免这些错误,我尝试在VS 2010中构建WebRTC lib文件,然后将它们链接到我的VS 2005解决方案。然而,这会带来其他类型的错误和警告(这是在2005年,再次):

warning LNK4229: invalid directive '/FAILIFMISMATCH:_MSC_VER=1600' encountered; ignored
error LNK2001: unresolved external symbol "void __cdecl std::_Xlength_error(char const *)" (?_Xlength_error@std@@YAXPBD@Z)
unresolved external symbol "void (__cdecl* std::_Raise_handler)(class stdext::exception const &)" (?_Raise_handler@std@@3P6AXABVexception@stdext@@@ZA)

我想知道,如果可以避免这些错误,那么我可以在VS 2005项目中使用VS 2010中生成的库。

1 个答案:

答案 0 :(得分:2)

您无法将libs链接到使用其他版本的visual studio构建的程序。

相关问题