GNOME Bugzilla – Bug 124590
Enforce ABI compatability at link time
Last modified: 2004-12-22 21:47:04 UTC
I would like to see Gtkmm implement a mechanism for ensuring that programs compiled against Gtkmm 2.2 (and in the future, 2.4), cannot be linked against Gtk 1.x libraries without a link-time error. If that isn't practically possible, then an informative library initialization-time error would be a decent fallback. As it currently stands, you can link a Gtk 2 application against Gtk 1 libraries, or a mixture of both versions of the libraries. The program then crashes with a segmentation fault at runtime. This cause of this segfault is not always immediately apparent, even to programmers. As a somewhat public example, a few months ago, a build of Evolution 1.2 was shipped on Debian Sid that was linked against both Glib 2 and 1.2 libraries. Several days passed with many complaints before the source of the crash was found. Preferably, the reverse should also be true; Gtk 1 applications should fail to link against Gtk 2 libs. I really don't have any idea how to implement this kind of protection, but I think I remember seeing some kind of ABI warning when linking GNU C++ programs against the wrong version of libstdc++. Thanks, Jonathan Brandmeyer
It is very difficult to create this problem, and I would expect any such program to fail immediately. Also, it's a generic problem and not a gtkmm problem.