1

I'm on Ubuntu 14.04, which has ImageMagick 6.7.7-10 installed by default. I need to use Magick++, a C++ API for ImageMagick, in a C++ project, but I have no idea where it's located. How can I tell if I have it, and if I don't, what's the best way to get it?

EDIT- Now that I've installed libmagick++-dev, where do I find Magick++.h, the header file I need to #include in my project?

4

Due to the mentioned page in your question

Usage

… A helper script named Magick++-config is installed under Unix which assists with recalling compilation options required to compile and link programs which use Magick++. …

I believe, you looking for the following:

% apt-file search Magick++-config
graphicsmagick-libmagick-dev-compat: /usr/bin/Magick++-config

and

% apt-file search Magick++.h     
graphicsmagick-libmagick-dev-compat: /usr/include/Magick++.h

                                               and here is your header file:                                                               

Therefore install graphicsmagick-libmagick-dev-compat

sudo apt-get install graphicsmagick-libmagick-dev-compat

Or simpler:

sudo apt-get install libgraphicsmagick1-dev

because:

% apt-rdepends graphicsmagick-libmagick-dev-compat | grep magick
Reading package lists... Done
Building dependency tree       
Reading state information... Done
graphicsmagick-libmagick-dev-compat
  Depends: libgraphics-magick-perl
  Depends: libgraphicsmagick++1-dev
  Depends: libgraphicsmagick1-dev
libgraphics-magick-perl
  Depends: libgraphicsmagick3 (>= 1.3.5)
libgraphicsmagick3
libgraphicsmagick++1-dev
  Depends: libgraphicsmagick++3 (= 1.3.20-4)
  Depends: libgraphicsmagick1-dev
libgraphicsmagick++3
  Depends: libgraphicsmagick3 (>= 1.3.15)
libgraphicsmagick1-dev
  Depends: libgraphicsmagick3 (= 1.3.20-4)

% apt-rdepends libgraphicsmagick1-dev | grep magick             
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libgraphicsmagick1-dev
  Depends: libgraphicsmagick3 (= 1.3.20-4)
libgraphicsmagick3
2

Let's see

$ apt-cache search dev | grep magick
libmagick++-dev - object-oriented C++ interface to ImageMagick - development files
libmagickcore-dev - low-level image manipulation library - development files
libmagickwand-dev - image manipulation library - development files
php5-imagick - ImageMagick module for php5
graphicsmagick-libmagick-dev-compat - image processing libraries providing ImageMagick interface
libghc-hsmagick-dev - FFI bindings for the GraphicsMagick library
libgraphicsmagick++1-dev - format-independent image processing - C++ development files
libgraphicsmagick1-dev - format-independent image processing - C development files

looks promising: so how about

$ apt-cache show libmagick++-dev
.
.
Description-en: object-oriented C++ interface to ImageMagick - development files
This package includes header files and static libraries needed to compile
programs using Magick++.

So it seems like you should install the libmagick++-dev package, either via the Software Center or from the command line using

sudo apt-get install libmagick++-dev
  • Great. How can I tell where it installed? – LastStar007 Jul 9 '15 at 21:35
  • @LastStar007 in Linux, packages generally consist of files that install in a variety of standard locations - it's not like Windows. You can see the complete list of installed file locations for a particular package using dpkg-query e.g. dpkg -L libmagick++-dev – steeldriver Jul 9 '15 at 21:42
1

After installing libmagick++-dev:

sudo apt-get install libmagick++-dev  

I ran:

sudo apt-file find Magick++.h  

This gave me multiple hits, but the relevant one was:

/usr/include/ImageMagick/Magick++.h
1

The following command (apt-file) works if you know the name of a needed file, but not necessarily the package name. However, if you know the package name, it works with that too.

...

"apt-file find" would be used to look for what specific file (of a package) is installed via the command line. Then "apt-get install" (via the command line) would be used to install the 'dev' version of the package. Otherwise, the Synaptic Package Manger (G.U.I.) can show what packages are already installed or not. However, when using the Synaptic Package Manager, the whole package first must be installed to actually see what individual file (of that package) is installed.

...

sudo apt-get install apt-file

...

sudo apt-file find libmagick++

...

sudo apt-file find libmagick++

libmagick++-dev: /usr/share/doc/libmagick++-dev/NEWS.Debian.gz
libmagick++-dev: /usr/share/doc/libmagick++-dev/changelog.Debian.gz
libmagick++-dev: /usr/share/doc/libmagick++-dev/copyright libmagick++5: /usr/share/doc/libmagick++5/NEWS.Debian.gz libmagick++5: /usr/share/doc/libmagick++5/changelog.Debian.gz libmagick++5: /usr/share/doc/libmagick++5/copyright

...

(The output of the command shows that there are some compressed doc's installed, but nothing else for "libmagick++", so libmagick++-dev should be installed...)

...

sudo apt-get install libmagick++-dev

protected by Community Jul 10 '15 at 18:08

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.