musescore / MuseScore

MuseScore is an open source and free music notation software. For support, contribution, bug reports, visit MuseScore.org. Fork and make pull requests!
https://musescore.org
Other
12.19k stars 2.64k forks source link

[Ubuntu] symbol lookup error: undefined symbol: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev because of Qt5.15.3 #19416

Open jokteur opened 1 year ago

jokteur commented 1 year ago

Issue type

Crash or freeze

Bug description

Hi,

I've been trying to launch MuseScore 4.1 on my ubuntu installation, and I have Qt5 symbol lookup problems. I know that may not necessarily be MuseScore fault, but I've been searching the internets to try to solve this problem.

When I download the MuseScore official App Image, and try to run it, I get the following error: undefined symbol: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev, version Qt_5

I've tried to compile MuseScore myself (to see if I can solve this problem). So install the specific Qt version (5.15.2) in a local folder as shown in the compilation guide. I managed to compile it (on v.4.1.1) and I still have this error whenever I try to run it.

The problem

After some digging, I found out that the conflict arise because I have Qt5.15.3 installed on my machine (other apps depend on it probably) and Musescore is loading Qt5.15.3 libraries instead of Qt5.15.2.

The symbol is present in my local Qt 5.15.2 library

If I do find /home/myname/qt -name '*.so*' -exec nm --print-file-name --defined-only --dynamic {} \; | grep "_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev", I get matches in

plugins/renderers/libopenglrenderer.so
lib/libQt5Qml.so
lib/libQt5Qml.so.5
lib/libQt5Positioning.so.5.15.2

The symbol is not present in the system Qt 5.15.3 installation

If I do the same command find /usr/lib/x86_64-linux-gnu '*.so*' -exec nm --print-file-name --defined-only --dynamic {} \; | grep "_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev", there are a few matches, but none of them is in the Qt5.15.3 shared libraries that are in the folder. When I do find /usr/lib/x86_64-linux-gnu '*.so*' -exec nm --print-file-name --defined-only --dynamic {} \; | grep "_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev@@Qt_5", I have no match.

Trying to use LD_PRELOAD

I tried to use LD_PRELOAD to solve the symbol problem, but then I have this problem:

Cannot mix incompatible Qt library (5.15.3) with this library (5.15.2)

Do you know how I could solve this problem ? Qt 5.15.3 is used by other apps, but MuseScore apparently needs Qt 5.15.2. . How can I tell Ubuntu to not load any Qt 5.15.3 library and load Qt 5.15.2 libraries instead ? It seems that mixing does not work, and I cannot uninstall the current Qt version from my system.

Steps to reproduce

  1. Have Qt 5.15.3 installed on your system
  2. Launch Musescore 4.1.1
  3. Battle with symbol dependency hell

Screenshots/Screen recordings

No response

MuseScore Version

4.1.1

Regression

Yes, this used to work in a previous version of MuseScore 4.x

Operating system

Ubuntu 22.04 LTS

Additional context

No response

cbjeukendrup commented 1 year ago

@shoogle Can you help with this one?

disini commented 7 months ago

hi buddy have you find some ways to solve this problem? I have same problem here on ubuntu 22.04, but my tips are :

symbol lookup error: /usr/bin/qmake6: undefined symbol: _ZN19QLibraryInfoPrivate13keyAndDefaultEN12QLibraryInfo11LibraryPathEP7QStringS3_, version Qt_6_PRIVATE_API

do you know what library file did I miss ? how should I do ? Thanks so much?

MikePooh commented 3 months ago

I've faced the sample problem when built my Qt based programm on Linux Mint 21.3 Virginia which has Qt5.15.3 by default and link it against Qt5.12.8 using QtCreator. It creates and rpath entry and if launch on same machine it works fine and run against 5.12.8 libs. However if remove rpath or try to run this app on another machine, the same to yours symbol lookup error occurs.

The solution - to build the app in environment with lower version of GLIBC. I've installed docker contianer with Ubuntu 20.04 and GLIBC version 2.31. This version of Ubuntu contains Qt5.12.8 from repos. So if build in this container and after run on machines mentioned above - all run smoothly.