Skip to content

Fix linking / duplicate instance() methods

The heart of the problem is that:

  • konsoleprofile is an OBJECT library, so it lives as independent objects until linked into something else (like a library)
  • konsoleprivate is a SHARED library, and with the default visibility rules, it exports only the things that are marked as exportable
  • kdeinit_konsole and konsolepart link to konsoleprivate

Inside of konsoleprivate, references to the instance() methods were already resolved -- to the copy inside the library. Since the methods were not exported, an extra copy of konsoleprofile was being linked to the executable and part. That was removed in 7599e7ee -- because with that extra copy of the object library, you had calls inside konsoleprivate resolving to one copy (the internal one already in the library), and calls from outside -- which are caused by the settings/ bits -- resolving to the extra copy. That leads to multiple instance()s.

So: export the instance symbols and the one method called from outside, so that the calls from outside resolve to the copy inside the library.

Merge request reports