1

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.

1 Answers1

2

You can't link libs to a program built with another version of visual studio.

puikos
  • 300
  • 1
  • 4
  • Indeed? How about the answer of Chris Becke to a similar question [here](http://stackoverflow.com/a/2048835/915913) ? – Alexander Shmuratko Dec 09 '11 at 14:10
  • he says "As long as the library API's use only raw types, and do not try to free() passed in pointers, or pass out pointers to internally malloc()'d memory that they expect the application (or another library) to free() you should be ok." Since you're using third party libs are you sure you will meet that requirement – puikos Dec 09 '11 at 14:20
  • Well, I see. Raw type = built-in type? So if a it's a C++ library, most likely I can't use it unless it was build with VS 2005 (provided I work in 2005) since it works with classes, and classes are not raw types. Is that right? – Alexander Shmuratko Dec 09 '11 at 14:41
  • yes, and you can also have modifications in functions signatures from different run times as it seems to be with your error. – puikos Dec 09 '11 at 14:50