multipass icon indicating copy to clipboard operation
multipass copied to clipboard

fix the linker error on ubuntu 24.04

Open georgeliao opened this issue 7 months ago • 1 comments

close #3558

A minimalistic example to reproduce this is to have an executable in Multipass CMake environment links to Qt6::Network and ssh where ssh target is built by the git submodule library libssh of multipass.

The problem here is that the executable links to libQt6Network.so.6.4.2->libcurl-gnutls.so.4->libssh.so.4 and 3rd-party libssh. So there are two libssh shared libraries linked to the same executable. Symbol versioning is a mechanism used in shared libraries to manage changes in the library API over time. In this case, the system libssh has the symbol version that linker is looking for but 3rd-party one does not have. Besides, the linker apparently is looking into the 3rd-party libssh for the functions he needs as opposed to the system libssh.

So one possible fix for this is to disambiguate the double libssh libraries by changing the 3rd-party libssh library from shared library to static library.

georgeliao avatar Jul 03 '24 13:07 georgeliao