views:

29

answers:

2

If a 3rd-party developer gives us .libs and/or .dlls generated with VC++ 2005, can they be used in VC++ 2008? What about if he compiles with 2008 Pro, and we run 2008 Standard/Express?

I know C++ is not as portable as it used to be, what with VC++ runtimes and so on, but I'd like to think at least we can use pre-existing libraries/dlls in a newer version of VC++.

+1  A: 

With regard to the 2008 Pro vs 2008 Standard/Express edition question, the code that these generate is 100% compatible. I've started projects on Pro and then continued developing them on Express and vice versa.

The binaries produced by the various 2008 editions will be compatible. All that changes is the functionality available in the IDE.

ChrisF
Compatible code != compatible binaries though. The question is if the lib you built in Express can be linked against an app built in Pro, or vice versa.
John
@John, my answer was perhaps badly worded. The binaries produced by the various 2008 editions will be compatible. All that changes is the functionality available in the IDE.
ChrisF
+1  A: 

You won't be able to use 2005 .libs with 2008 - they link to different runtime libraries and the object layout and vtable structure may be slightly different.

You may be able to use .dlls between different versions, but it very much depends on the interface of the .dll. If it exports classes or methods the take classes as parameters or return them, then probably not.

Joe Gauterin
Well I can use the Windows system DLLs, written years ago... I can see you are likely to be right on libs though.
John
Yes - as I said, compatibility with a .dll depends on the kind of interface. Pure C interfaces, such as the win32 api .dlls, are safe.
Joe Gauterin