在 VS 2010 中构建库以便在 VS 2005 中使用?
我需要在 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 中生成的库。
I need to use WebRTC in VS 2005. As far as I've found out, I need VS 2005 SP1 for this purpose. Otherwise, two link errors appear all the time:
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
I can't install SP1 for some reason. So to avoid these errors, I tried to build WebRTC lib-files in VS 2010 and then to link them to my VS 2005 solution. However, this brings about other kinds of errors and warnings (this is in 2005, again):
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)
I wonder, if these errors could be avoided, so that I could use the libs generated in VS 2010 in my VS 2005 project.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您无法将库链接到使用其他版本的 Visual Studio 构建的程序。
You can't link libs to a program built with another version of visual studio.