Issue
I just installed qemu on my Ubuntu 18.04.4 LTS via apt-get, but when I executed qemu-system-aarch64
command it said:
qemu-system-aarch64: symbol lookup error: /usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0: undefined symbol: cairo_ft_scaled_font_unlock_face
After that, I used nm -gD libpangocairo-1.0.so.0 | grep cairo_ft
command to check symbols in the mentioned library and I found:
U cairo_ft_scaled_font_unlock_face
which indicated the symbol was there in the library. So I wonder what caused the qemu binary couldn't find the existing symbol?
Solution
"U" means "undefined" -- that is, libpangocairo-1.0.so.0 requires this symbol, and expects it to be provided by some other library.
On my Ubuntu system this is provided by /usr/lib/x86_64-linux-gnu/libcairo.so.2.11600.0, where 'nm -gD' lists it with a 'T' meaning "defined in this file's text section". (I'm using Ubuntu 20.04 so the exact libcairo .so filename is probably different for you.)
00000000000c1f30 T cairo_ft_scaled_font_unlock_face
On Ubuntu that library should be in the 'libcairo2' package. However, the Ubuntu package that provides 'libpangocairo' depends on libcairo2 and should have installed it automatically. You should therefore check whether there's something broken on your system (e.g. you have an incompatible install of parts of libcairo or libpango in /usr/local or otherwise on your library load path before the system versions of the library, or you've accidentally managed to delete some of the files that libcairo2 installs).
Answered By - Peter Maydell Answer Checked By - Senaida (WPSolving Volunteer)