Link to home
Start Free TrialLog in
Avatar of haider
haiderFlag for Pakistan

asked on

Use VS 2005 compiled library in VS 2008

Hi

I've a library that is compiled with VS 2005. I need to use that in a C++ win32 console project in VS 2008. I get an error
fatal error LNK1257: code generation failed

Is it really required to rebuild that library in VS 2008. Just curious, how windows libraries are linked in the projects irrespective of the visual studio versions.

Regards

Avatar of evilrix
evilrix
Flag of United Kingdom of Great Britain and Northern Ireland image

>> Is it really required to rebuild that library in VS 2008.
Generally you cannot rely on a library build in one version of a compiler working in another, especially if it's a C++ library. There is no standard ABI defined in the C++ standards doc do each compiler is free to use whatever name-mangling or binary interface is wishes. Vendors often change things between versions to facilitate improvements to the binary code.

http://en.wikipedia.org/wiki/Application_binary_interface 
ASKER CERTIFIED SOLUTION
Avatar of mrjoltcola
mrjoltcola
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial