goimagemagickmagickwand

unable to build magick for golang


I am following this document for building the Go Imagick library.

When i ran the following command

go build -tags no_pkgconfig imagick

It throws the following exception :

# imagick
src/imagick/affine_matrix.go:8:29: fatal error: wand/MagickWand.h: No such file or directory
compilation terminated

Now to resolve that i have also installed the following packages as many people suggested to resolve the error. But it didn't work either.

sudo apt-get install libmagickwand-dev libmagickcore-dev imagemagick

Moreover, when i run go build imagick It throws the following error :

# imagick
could not determine kind of name for C.FlattenAlphaChannel
could not determine kind of name for C.RemoveAlphaChannel

Output of pkg-config --cflags --libs MagickWand gives the correct output

-fopenmp -I/usr/include/ImageMagick  -lMagickWand -lMagickCore

ImageMagick is installed to this path(/usr/include/ImageMagick) only.


Solution

  • As mentioned on #68 of the issue tracker, you are using way too old of a version of ImageMagick, which predates the versions that were tested for the master branch. Your Linux distro is older than the current available stable release.

    You should manually install a newer ImageMagick, and remove the, one from apt. Or use some solution that allows you to manage multiple versions.