Octave imread function

I installed latest Octave on Ubuntu 14.04 machine. However, when I tried to run imread command, it showed the following error message:

octave:12> imread('newfile.png')
error: imread: invalid image file: /usr/lib/x86_64-linux-gnu/octave/3.8.1/oct/x86_64-pc-linux-gnu/__magick_read__.oct: failed to load: /usr/lib/x86_64-linux-gnu/octave/3.8.1/oct/x86_64-pc-linux-gnu/__magick_read__.oct: undefined symbol: _ZN6Magick5ColorC1Ehhh
error: called from:
error:   /usr/share/octave/3.8.1/m/image/private/__imread__.m at line 181, column 7
error:   /usr/share/octave/3.8.1/m/image/private/imageIO.m at line 66, column 26
error:   /usr/share/octave/3.8.1/m/image/imread.m at line 107, column 30

Can someone please suggest how to solve it?

Thanks!


Following these steps worked for me [Author: Christoffer Cronström (hymyly)]:

Install the dev packages needed to build octave.

sudo apt-get build-dep octave

Get the official source package. Do this in a clean directory, because it will get polluted.

cd ~/some/suitable/directory
apt-get source octave

Build it. This took roughly an hour for me.

cd octave-3.8.2
dpkg-buildpackage

Either run it from the build directory:

./run-octave

...or most preferably install it over the official octave:

cd ..
sudo dpkg --install octave_3.8.2-4_amd64.deb

From: https://bugs.launchpad.net/ubuntu/+source/octave/+bug/1372202


How did you instal Octave? The error suggests that you're missing GraphicsMagick C++ interface (package libgraphicsmagick++3 ) but

  • if you installed Octave from Ubuntu's package manager you should not have had this problem; * if you compiled it yourself, Octave should have disabled imread completely and you'd have a very different error message.
  • So my guess is that you build it yourself, either with:

  • your own build of GraphicsMagick++ which are not being loaded anymore, you may need to add their path to the dynamic linker load path (either on /etc/ld.so.conf.d./graphicsmagick or define LD_LIBRARY_PATH );

  • the libraries from the package manager which you have since accidentally removed (since you did not install Octave from the repositories, your package manager will not know that libgraphicsmagick++ is installed for a reason).

  • Either way, the solution is easy. Install Octave from Ubuntu's package manager. One of the main reasons package managers exist is to avoid this type of problems, ie, missing dependencies.

    链接地址: http://www.djcxy.com/p/22126.html

    上一篇: 我可以获得OWIN cookie并解密它以在BeginRequest中获得它的声明吗?

    下一篇: 八度嵌入函数