Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are C++ libs created with different versions of Visual Studio compatible with each other?

Tags:

c++

I am creating a open-source C++ library using Visual Studio 2005. I would like to provide prebuilt libs along with the source code. Are these libs, built with VS2005, also going to work with newer versions of Visual Studio (esp VS Express Edition 2008)? Or do I need to provide separate libs per VS version?

like image 245
StackedCrooked Avatar asked Oct 21 '09 12:10

StackedCrooked


People also ask

Are Visual Studio versions backwards compatible?

You can install and use Visual Studio 2019 alongside previous versions of Visual Studio, including Visual Studio 2017, Visual Studio 2015, Visual Studio 2013, and Visual Studio 2012.

What version of C does Visual Studio 2019 use?

Microsoft's Visual Studio IDE has added support for the C11 and C17 C language standards, thus expanding the IDE's previously limited support for C. C11 and C17 become supported language versions starting with Visual Studio 2019 16.8 Preview 3, which was released September 14.

What is .LIB file in Visual Studio?

The Microsoft Library Manager (LIB.exe) creates and manages a library of Common Object File Format (COFF) object files. LIB can also be used to create export files and import libraries to reference exported definitions. You can start this tool only from the Visual Studio command prompt.


1 Answers

Not normally, no. Libraries built with the VS tools are linked into the 'Microsoft C Runtime' (called MSVCRT followed by a version number) which provides C and C++ standard library functions, and if you attempt to run a program that requires two different versions of this runtime then errors will occur.

On top of this, different compiler versions churn out different compiled code and the code from one compiler version frequently isn't compatible with another apart from in the most trivial cases (and if they churned out the same code then there would be no point having different versions :))

like image 85
workmad3 Avatar answered Oct 03 '22 22:10

workmad3