When trying to build ImageMagick-7.0.8-36 from source on Ubuntu 18.01 I'm getting the following error (_coders/heic.c:564:20: error: incompatible types when assigning to type ‘struct heif_error’ from type ‘int’ error=heif_context_add_XMP_metadata(ctx,image_handle,.._):
...
CC coders/MagickCore_libMagickCore_7_Q16HDRI_la-ycbcr.lo
CC coders/MagickCore_libMagickCore_7_Q16HDRI_la-yuv.lo
CC coders/MagickCore_libMagickCore_7_Q16HDRI_la-djvu.lo
CC coders/MagickCore_libMagickCore_7_Q16HDRI_la-exr.lo
CC coders/MagickCore_libMagickCore_7_Q16HDRI_la-heic.lo
coders/heic.c: In function ‘WriteProfile’:
coders/heic.c:546:18: _warning_: implicit declaration of function ‘heif_context_add_exif_metadata’; did you mean ‘heif_image_handle_get_metadata’? [-Wimplicit-function-declaration]
(void) heif_context_add_exif_metadata(ctx,image_handle,
^~~~~~~~
heif_image_handle_get_metadata
coders/heic.c:564:21: _warning_: implicit declaration of function ‘heif_context_add_XMP_metadata’; did you mean ‘heif_image_handle_get_metadata’? [-Wimplicit-function-declaration]
error=heif_context_add_XMP_metadata(ctx,image_handle,
^~~~~~~
heif_image_handle_get_metadata
coders/heic.c:564:20: error: incompatible types when assigning to type ‘struct heif_error’ from type ‘int’
error=heif_context_add_XMP_metadata(ctx,image_handle,
^
coders/heic.c:502:5: _warning_: variable ‘iptc’ set but not used [-Wunused-but-set-variable]
iptc;
^~~~
Makefile:9614: recipe for target 'coders/MagickCore_libMagickCore_7_Q16HDRI_la-heic.lo' failed
make[1]: * [coders/MagickCore_libMagickCore_7_Q16HDRI_la-heic.lo] Error 1
make[1]: Leaving directory '/home/dev33/yorik/soft/ImageMagick-7.0.8-36'
Makefile:5761: recipe for target 'all' failed
make: * [all] Error 2
Uncomment "deb-src http://ua.archive.ubuntu.com/ubuntu/ bionic main restricted" in /etc/apt/sources.list
$ sudo apt update
$ sudo apt build-dep imagemagick
$ wget https://www.imagemagick.org/download/ImageMagick.tar.gz
$ tar xvzf ImageMagick.tar.gz
$ cd ImageMagick-7.0.8-36
$ ./configure
$ make
Ubuntu 18.04.1 LTS 64-bit
Sorry, what am I doing wrong?
Thanks in advance
Meanwhile I successfully installed ImageMagick 6.9.10-36
I had the same issue building the latest version (version 7.0.7-22 had built successfully). I had originally installed libheif from the PPA. The problem was solved by building libheif 1.4.0 from source, and then building ImageMagick 7.0.8-37.
I am facing the same problem on ubuntu 18.04.
What I did was I purged libheif-dev with sudo apt-get purge libheif-dev and then proceed to ./configure && make
This will not compile with the heif delegate though, but it does compile successfully.
If you want it to compile with HEIF support you must build libheif 1.4.0 from source first.
It seems that we missed a check for the minimum version of libheif that is required for heif_context_add_exif_metadata and heif_context_add_XMP_metadata. You will need to at least version 1.3.0 for this. The checks will be added in the next release.