DigitalEye
DigitalEye

Reputation: 1565

VS 2012 interoperability with VS 2010

My application written in C++ is built with Visual Studio 2010, and it needs to link against two external dynamic libraries. One of those libraries was built with VS 2010 (no problems here) but the other library was built with VS 2012. Will this scheme work? Is this common--linking libraries built with differing compiler versions into an application which itself might have been built with a different compiler. If this won't work or if this practice is discouraged, I'd like to understand what prevents interoperability in cases like this.

Upvotes: 0

Views: 58

Answers (1)

PaulMcKenzie
PaulMcKenzie

Reputation: 35440

If the exported functions use a 'C' interface, and the parameters/return types are generic Windows API types such as LONG, DWORD, TSTR, BOOL, etc. or pointers to these types, then there shouldn't be a problem using a DLL created with different versions of Visual Studio.

Personally, I have built DLL's with VS 2010 and used it with apps built with VS 6.0 using these guidelines.

If however your DLL's exported functions passes types such as STL or MFC types, or things such as FILE , then you have an issue, as these types differ among compiler versions. You have no choice but to make sure your application and DLL's match VS version.

Upvotes: 3

Related Questions