binary-compatibility

Binary compatibility between VS2017 and VS2015

徘徊边缘 提交于 2019-12-02 02:12:49
This SO post: Is Visual-C++-2017 binary compatible with VC++-2015? clearly says that VS 2017 is binary compatible with VS 2015. It even looks like the official position. My question is, in the past, I distinctly remember running into linker errors (I do not recall the specific set of errors) every time I try to link in a static library that was compiled with a different version of MSVC into an EXE that is being built with a newer version of MSVC. Yet, binary (in)compatibility sounds like something that will blow up in your face at runtime , not link time. Can someone tell me if previous

Does changing the return type of a function for a child type breaks binary compatibility?

↘锁芯ラ 提交于 2019-12-01 21:29:07
Let's go straight to it : Old code : public interface IFoo {} public class Foo : IFoo {} ... public static IFoo Bar() { return new Foo(); } New code : public static Foo Bar() { return new Foo(); } Obviously there should be no problem here, everything you were doing on the old return type, you can still do on the new return type, any is , as or cast should behave the same as before... So did I break binary compatibility, or can I just release it as a minor version without bothering users ? This breaks binary compatibility, but not (most) compile-time compatibility issues, so it's typically an

About the binary compatibility of Linux

徘徊边缘 提交于 2019-12-01 06:40:48
If I get some C++ code built by, lets say, GCC 4.8 on Ubuntu, the code has no GUI/interface, only call standard Linux libraries, then can the binary run on RHEL 5/6, with much older GCC flawlessly? Normally it can't. It will complain about libc being too old, for one. If you statically link with libstdc++ and carefully avoid newer glibc features, you may be able to get away with it. The latter is not always possible though. Static linking with libc is not officially supported and may work or not work for you. The issue is probably more Glibc than libstdc++ (which you can indeed link statically

Runtime error (dll loading) with win32 applications on x64 system, while compiling 0K

孤街浪徒 提交于 2019-12-01 05:26:45
I originally designed a win32 application on win7 32bits, with VC9.0. I recently upgraded to win7 64 bits, and tried to build+execute the previous application. Building runs fine (win32 application), but on runtime I get the error "[...] has exited with code -1073741701 (0xc000007b)." I guess this results of the loading of a 64bits version of an [intended] 32bits dll. Specific dependencies for this project are: SDL.lib SDLmain.lib SDL_ttf.lib opengl32.lib glu32.lib wininet.lib SDL and SDL_ttf are only in 32bits version. I assume that Visual Studio is clever enough to fetch the opengl and glu

Library ABI compatibility between versions of Visual Studio

十年热恋 提交于 2019-11-30 18:26:04
I have two scenarios. Suppose I have 3 shared libraries that export C++ symbols, each built with VS7.1, VS8, and VS9. I compile all 3 in VS9. For some reason, this works. I do not need to recompile the first 2 libraries in VS9 for VS9 linker to successfully find the symbols and link against them. Now, if I have a library that only exports symbols using C syntax (extern "C"), is this the same? I've heard people say that the ABI for C is standardized, so there is somewhat of a guarantee that you can use a C library compiled in Visual Studio 8 in all versions of Visual Studio. Basically, the

Does adding enum values break binary compatibility?

无人久伴 提交于 2019-11-30 18:25:24
Imagine this enum in a DLL. public enum Colors { Red, Green } Does adding enum values break binary compatibility? If I were to change it, would existing EXEs break? public enum Colors { Red, Green, Blue } I saw this answer , but it seemed to address the case of inserting a value. If I add values to the end only , is that OK? No, this doesn't break binary compatibility (in as much as: the assembly will still load etc), because enums are basically integer literal constants. Inserting values in the middle is obviously a really dangerous idea, but you've already excluded that. However, it can

Java binary compatibility issue: sun.font.FontManager class became interface

五迷三道 提交于 2019-11-30 13:56:05
I am using the Lobo - Java Web Browser library, and it gives me an exception which after some research I determined could be due to the library having been complied against an older version of Java. The code is as follows: import java.io.IOException; import org.lobobrowser.html.UserAgentContext; import org.lobobrowser.html.parser.DocumentBuilderImpl; import org.lobobrowser.html.parser.InputSourceImpl; import org.lobobrowser.html.test.SimpleUserAgentContext; import org.xml.sax.SAXException; public class Cobratest { public static void main(String[] args) throws SAXException, IOException {

Retrofitting void methods to return its argument to facilitate fluency: breaking change?

て烟熏妆下的殇ゞ 提交于 2019-11-30 02:04:55
"API design is like sex: make one mistake and support it for the rest of your life" ( Josh Bloch on twitter ) There are many design mistakes in the Java library. Stack extends Vector ( discussion ), and we can't fix that without causing breakage. We can try to deprecate Integer.getInteger ( discussion ), but it's probably going to stay around forever. Nonetheless, certain kinds of retrofitting can be done without causing breakage. Effective Java 2nd Edition, Item 18: Prefer interfaces to abstract classes : Existing classes can be easily retrofitted to implement a new interface". Examples:

Java binary compatibility issue: sun.font.FontManager class became interface

浪子不回头ぞ 提交于 2019-11-29 20:55:02
问题 I am using the Lobo - Java Web Browser library, and it gives me an exception which after some research I determined could be due to the library having been complied against an older version of Java. The code is as follows: import java.io.IOException; import org.lobobrowser.html.UserAgentContext; import org.lobobrowser.html.parser.DocumentBuilderImpl; import org.lobobrowser.html.parser.InputSourceImpl; import org.lobobrowser.html.test.SimpleUserAgentContext; import org.xml.sax.SAXException;

Dll compatibility between compilers

匆匆过客 提交于 2019-11-29 18:36:09
问题 Is there some way to make c++ dlls built with diffrent compilers compatible with each other? The classes can have factory methods for creation and destruction, so each compiler can use its own new/delete (since diffrent runtimes have there own heaps). I tried the following code but it crashed on the first member method: interface.h #pragma once class IRefCounted { public: virtual ~IRefCounted(){} virtual void AddRef()=0; virtual void Release()=0; }; class IClass : public IRefCounted { public: