Inkscape Ubuntu 16.04 - 未定义符号:_ZN6Magick5Image4readERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE

Inkscape Ubuntu 16.04 - 未定义符号:_ZN6Magick5Image4readERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
$ inkscape

inkscape: symbol lookup error: inkscape: undefined symbol: _ZN6Magick5Image4readERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE

经过不同的搜索组合后,偶然发现了一个旧的未关闭的线程,关键字为 _ZN6Magick5Image4readERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE,否则什么也没有

切换到稳定版本 inkscape 后

$ sudo add-apt-repository ppa:inkscape.dev/stable

现在接收

inkscape:符号查找错误:/usr/bin/../lib/inkscape/libinkscape_base.so:未定义符号:_ZN6Magick5Image4readERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE

@N0rbert

$ apt-cache policy $(dpkg -S $(which inkscape)) 
inkscape: 
    Installed: 0.92.4+68~ubuntu16.04.1 
    Candidate: 0.92.4+68~ubuntu16.04.1 
    Version table: 
   *** 0.92.4+68~ubuntu16.04.1 500 
          500 http://ppa.launchpad.net/inkscape.dev/stable/ubuntu xenial/main amd64 Packages 
          100 /var/lib/dpkg/status 
       0.91-7ubuntu2 500 
          500 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 Packages N: Unable to locate package /usr/bin/inkscape

@N0rbert 但是没有错误

$ sudo apt-get install inkscape=0.91-7ubuntu2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libgraphics-magick-perl libpotrace0 python-scour
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libimage-magick-perl
Suggested packages:
  pstoedit dia | dia-gnome libsvg-perl libxml-xql-perl imagemagick-doc
Recommended packages:
  imagemagick
The following packages will be REMOVED:
  graphicsmagick-libmagick-dev-compat
The following NEW packages will be installed:
  libimage-magick-perl
The following packages will be DOWNGRADED:
  inkscape
0 upgraded, 1 newly installed, 1 downgraded, 1 to remove and 0 not upgraded.
Need to get 0 B/12.3 MB of archives.
After this operation, 48.5 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 233797 files and directories currently installed.)
Removing graphicsmagick-libmagick-dev-compat (1.3.23-1ubuntu0.1) ...
Processing triggers for man-db (2.7.5-1) ...
dpkg: warning: downgrading inkscape from 0.92.4+68~ubuntu16.04.1 to 0.91-7ubuntu2
(Reading database ... 233779 files and directories currently installed.)
Preparing to unpack .../inkscape_0.91-7ubuntu2_amd64.deb ...
Unpacking inkscape (0.91-7ubuntu2) over (0.92.4+68~ubuntu16.04.1) ...
Selecting previously unselected package libimage-magick-perl.
Preparing to unpack .../libimage-magick-perl_8%3a6.8.9.9-7ubuntu5.13_all.deb ...
Unpacking libimage-magick-perl (8:6.8.9.9-7ubuntu5.13) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for hicolor-icon-theme (0.15-0ubuntu1.1) ...
Processing triggers for gnome-menus (3.13.3-6ubuntu3.1) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu5.2) ...
Processing triggers for bamfdaemon (0.5.3~bzr0+16.04.20180209-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for mime-support (3.59ubuntu1) ...
Setting up inkscape (0.91-7ubuntu2) ...
Setting up libimage-magick-perl (8:6.8.9.9-7ubuntu5.13) ...
$ inkscape
inkscape: symbol lookup error: inkscape: undefined symbol: _ZN6Magick5Image4readERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE

@N0rbert

$ ldd $(which inkscape)
linux-vdso.so.1 =>  (0x00007ffcff1e9000)
libgtkspell.so.0 => /usr/lib/libgtkspell.so.0 (0x00007f64a9267000)
libgtkmm-2.4.so.1 => /usr/lib/x86_64-linux-gnu/libgtkmm-2.4.so.1 (0x00007f64a8c44000)
libatkmm-1.6.so.1 => /usr/lib/x86_64-linux-gnu/libatkmm-1.6.so.1 (0x00007f64a89fa000)
libgdkmm-2.4.so.1 => /usr/lib/x86_64-linux-gnu/libgdkmm-2.4.so.1 (0x00007f64a87ad000)
libpangomm-1.4.so.1 => /usr/lib/x86_64-linux-gnu/libpangomm-1.4.so.1 (0x00007f64a8580000)
libgtk-x11-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0 (0x00007f64a7f35000)
libgdk-x11-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0 (0x00007f64a7c80000)
libpangocairo-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0 (0x00007f64a7a73000)
libgdk_pixbuf-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0 (0x00007f64a7851000)
libgc.so.1 => /usr/lib/x86_64-linux-gnu/libgc.so.1 (0x00007f64a75df000)
libcairomm-1.0.so.1 => /usr/lib/x86_64-linux-gnu/libcairomm-1.0.so.1 (0x00007f64a73bb000)
libgiomm-2.4.so.1 => /usr/lib/x86_64-linux-gnu/libgiomm-2.4.so.1 (0x00007f64a7017000)
libglibmm-2.4.so.1 => /usr/lib/x86_64-linux-gnu/libglibmm-2.4.so.1 (0x00007f64a6d9e000)
libgsl.so.19 => /usr/lib/x86_64-linux-gnu/libgsl.so.19 (0x00007f64a695f000)
libgslcblas.so.0 => /usr/lib/x86_64-linux-gnu/libgslcblas.so.0 (0x00007f64a6721000)
libpng12.so.0 => /lib/x86_64-linux-gnu/libpng12.so.0 (0x00007f64a64fc000)
libxslt.so.1 => /usr/lib/x86_64-linux-gnu/libxslt.so.1 (0x00007f64a62bf000)
libxml2.so.2 => /usr/lib/x86_64-linux-gnu/libxml2.so.2 (0x00007f64a5f04000)
libpangoft2-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0 (0x00007f64a5cee000)
libpango-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpango-1.0.so.0 (0x00007f64a5aa2000)
libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007f64a585f000)
libsigc-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libsigc-2.0.so.0 (0x00007f64a5659000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f64a543f000)
libgomp.so.1 => /usr/lib/x86_64-linux-gnu/libgomp.so.1 (0x00007f64a521d000)
libpopt.so.0 => /lib/x86_64-linux-gnu/libpopt.so.0 (0x00007f64a5011000)
libaspell.so.15 => /usr/lib/x86_64-linux-gnu/libaspell.so.15 (0x00007f64a4d67000)
libgnomevfs-2.so.0 => /usr/lib/x86_64-linux-gnu/libgnomevfs-2.so.0 (0x00007f64a4afe000)
libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007f64a4854000)
libwpg-0.3.so.3 => /usr/lib/x86_64-linux-gnu/libwpg-0.3.so.3 (0x00007f64a4638000)
libvisio-0.1.so.1 => /usr/lib/x86_64-linux-gnu/libvisio-0.1.so.1 (0x00007f64a439e000)
libcdr-0.1.so.1 => /usr/lib/x86_64-linux-gnu/libcdr-0.1.so.1 (0x00007f64a4103000)
librevenge-0.0.so.0 => /usr/lib/x86_64-linux-gnu/librevenge-0.0.so.0 (0x00007f64a3edb000)
librevenge-stream-0.0.so.0 => /usr/lib/x86_64-linux-gnu/librevenge-stream-0.0.so.0 (0x00007f64a3cbd000)
libMagick++-6.Q16.so.5 => /usr/local/lib/libMagick++-6.Q16.so.5 (0x00007f64a3a39000)
libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f64a36ff000)
libjpeg.so.8 => /usr/lib/x86_64-linux-gnu/libjpeg.so.8 (0x00007f64a34a6000)
liblcms2.so.2 => /usr/lib/x86_64-linux-gnu/liblcms2.so.2 (0x00007f64a324f000)
libpoppler.so.58 => /usr/lib/x86_64-linux-gnu/libpoppler.so.58 (0x00007f64a2dd0000)
libpoppler-glib.so.8 => /usr/lib/x86_64-linux-gnu/libpoppler-glib.so.8 (0x00007f64a2b78000)
libgobject-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007f64a2925000)
libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f64a2614000)
libcairo.so.2 => /usr/lib/x86_64-linux-gnu/libcairo.so.2 (0x00007f64a2300000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f64a1f7e000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f64a1c75000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f64a1a5f000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f64a1842000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f64a1478000)
libenchant.so.1 => /usr/lib/x86_64-linux-gnu/libenchant.so.1 (0x00007f64a126c000)
libatk-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libatk-1.0.so.0 (0x00007f64a1047000)
libgmodule-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0 (0x00007f64a0e43000)
libXfixes.so.3 => /usr/lib/x86_64-linux-gnu/libXfixes.so.3 (0x00007f64a0c3d000)
libgio-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0 (0x00007f64a08b5000)
libXrender.so.1 => /usr/lib/x86_64-linux-gnu/libXrender.so.1 (0x00007f64a06ab000)
libXinerama.so.1 => /usr/lib/x86_64-linux-gnu/libXinerama.so.1 (0x00007f64a04a8000)
libXi.so.6 => /usr/lib/x86_64-linux-gnu/libXi.so.6 (0x00007f64a0298000)
libXrandr.so.2 => /usr/lib/x86_64-linux-gnu/libXrandr.so.2 (0x00007f64a008d000)
libXcursor.so.1 => /usr/lib/x86_64-linux-gnu/libXcursor.so.1 (0x00007f649fe83000)
libXcomposite.so.1 => /usr/lib/x86_64-linux-gnu/libXcomposite.so.1 (0x00007f649fc80000)
libXdamage.so.1 => /usr/lib/x86_64-linux-gnu/libXdamage.so.1 (0x00007f649fa7d000)
libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007f649f86b000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f649f667000)
/lib64/ld-linux-x86-64.so.2 (0x00007f64aa537000)
libicuuc.so.55 => /usr/lib/x86_64-linux-gnu/libicuuc.so.55 (0x00007f649f2d3000)
liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f649f0b1000)
libharfbuzz.so.0 => /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0 (0x00007f649ee53000)
libthai.so.0 => /usr/lib/x86_64-linux-gnu/libthai.so.0 (0x00007f649ec4a000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f649ea21000)
libgconf-2.so.4 => /usr/lib/x86_64-linux-gnu/libgconf-2.so.4 (0x00007f649e7f2000)
libdbus-glib-1.so.2 => /usr/lib/x86_64-linux-gnu/libdbus-glib-1.so.2 (0x00007f649e5cb000)
libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007f649e37f000)
libgnutls.so.30 => /usr/lib/x86_64-linux-gnu/libgnutls.so.30 (0x00007f649e04f000)
libavahi-glib.so.1 => /usr/lib/x86_64-linux-gnu/libavahi-glib.so.1 (0x00007f649de4b000)
libavahi-common.so.3 => /usr/lib/x86_64-linux-gnu/libavahi-common.so.3 (0x00007f649dc3f000)
libavahi-client.so.3 => /usr/lib/x86_64-linux-gnu/libavahi-client.so.3 (0x00007f649da2e000)
libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f649d813000)
libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f649d610000)
libwpd-0.10.so.10 => /usr/lib/x86_64-linux-gnu/libwpd-0.10.so.10 (0x00007f649d383000)
libicui18n.so.55 => /usr/lib/x86_64-linux-gnu/libicui18n.so.55 (0x00007f649cf21000)
libMagickWand-6.Q16.so.2 => /usr/local/lib/libMagickWand-6.Q16.so.2 (0x00007f649cc2b000)
libMagickCore-6.Q16.so.2 => /usr/local/lib/libMagickCore-6.Q16.so.2 (0x00007f649c67a000)
libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f649c458000)
libtiff.so.5 => /usr/lib/x86_64-linux-gnu/libtiff.so.5 (0x00007f649c1e3000)
libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007f649bfdb000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f649bd6b000)
libpixman-1.so.0 => /usr/lib/x86_64-linux-gnu/libpixman-1.so.0 (0x00007f649bac3000)
libxcb-shm.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0 (0x00007f649b8bf000)
libxcb-render.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-render.so.0 (0x00007f649b6b5000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f649b4ad000)
libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007f649b28b000)
libicudata.so.55 => /usr/lib/x86_64-linux-gnu/libicudata.so.55 (0x00007f64997d4000)
libgraphite2.so.3 => /usr/lib/x86_64-linux-gnu/libgraphite2.so.3 (0x00007f64995ae000)
libdatrie.so.1 => /usr/lib/x86_64-linux-gnu/libdatrie.so.1 (0x00007f64993a6000)
libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007f64aa699000)
libp11-kit.so.0 => /usr/lib/x86_64-linux-gnu/libp11-kit.so.0 (0x00007f6499142000)
libidn.so.11 => /usr/lib/x86_64-linux-gnu/libidn.so.11 (0x00007f6498f0f000)
libtasn1.so.6 => /usr/lib/x86_64-linux-gnu/libtasn1.so.6 (0x00007f6498cfc000)
libnettle.so.6 => /usr/lib/x86_64-linux-gnu/libnettle.so.6 (0x00007f6498ac6000)
libhogweed.so.4 => /usr/lib/x86_64-linux-gnu/libhogweed.so.4 (0x00007f6498893000)
libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007f6498613000)
libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f649840f000)
libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f6498209000)
libjbig.so.0 => /usr/lib/x86_64-linux-gnu/libjbig.so.0 (0x00007f6497ffb000)
libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007f6497d1a000)
libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007f6497b06000)

实际上

$ ls /usr/local/lib/libMagick<TAB>
libMagick++-6.Q16.a
libMagick++-7.Q16HDRI.so.4
libMagickCore-7.Q16HDRI.la
libMagickWand-6.Q16.so.2.0.0
libMagick++-6.Q16.la
libMagick++-7.Q16HDRI.so.4.0.0
libMagickCore-7.Q16HDRI.so
libMagickWand-7.Q16HDRI.a
libMagick++-6.Q16.so
libMagickCore-6.Q16.a
libMagickCore-7.Q16HDRI.so.6
libMagickWand-7.Q16HDRI.la
libMagick++-6.Q16.so.5
libMagickCore-6.Q16.la
libMagickCore-7.Q16HDRI.so.6.0.0
libMagickWand-7.Q16HDRI.so
libMagick++-6.Q16.so.5.0.0
libMagickCore-6.Q16.so
libMagickWand-6.Q16.a
libMagickWand-7.Q16HDRI.so.6
libMagick++-7.Q16HDRI.a
libMagickCore-6.Q16.so.2
libMagickWand-6.Q16.la
libMagickWand-7.Q16HDRI.so.6.0.0
libMagick++-7.Q16HDRI.la
libMagickCore-6.Q16.so.2.0.0
libMagickWand-6.Q16.so            
libMagick++-7.Q16HDRI.so
libMagickCore-7.Q16HDRI.a
libMagickWand-6.Q16.so.2

这些都应该被删除吗

如果有帮助的话我手动安装了 ImageMagick 7(当然),因为在搜索引擎搜索的第一集中某个地方我想到要这样做:

$ sudo apt-get install --reinstall libMagick++

导致

The following packages have unmet dependencies:
 graphicsmagick-libmagick-dev-compat : Conflicts: libmagick++-dev
                                       Conflicts: libmagick++-dev:i386
                                       Conflicts: libmagickcore-dev but 8:6.8.9.9-7ubuntu5.13 is to be installed
                                       Conflicts: libmagickcore-dev:i386

答案1

我怀疑导致/usr/local/lib问题的原因有三个库:

libMagick++-6.Q16.so.5 => /usr/local/lib/libMagick++-6.Q16.so.5 (0x00007f64a3a39000)
libMagickWand-6.Q16.so.2 => /usr/local/lib/libMagickWand-6.Q16.so.2 (0x00007f649cc2b000)
libMagickCore-6.Q16.so.2 => /usr/local/lib/libMagickCore-6.Q16.so.2 (0x00007f649c67a000)

您需要使用以下方法删除它们

sudo rm /usr/local/lib/libMagick++-6.Q16.so.5
sudo rm /usr/local/lib/libMagickWand-6.Q16.so.2
sudo rm /usr/local/lib/libMagickCore-6.Q16.so.2

并安装 deb-packaged

sudo apt-get install --reinstall libmagick++-6.q16-5v5:amd64
sudo apt-get install --reinstall libmagickwand-6.q16-2:amd64
sudo apt-get install --reinstall libmagickcore-6.q16-2:amd64

然后使用任意版本的 Inkscape。从 deb 打包版本开始(即0.91-7ubuntu2)。


注意:似乎您以前曾手动编译过 ImageMagick。因此,您在 中拥有这些库/usr/local/lib。不建议这样做,因为您可能会得到库混乱(正如您从本期看到的那样)。

相关内容