Libvips: Error while building with libde265-dev libheif-dev installed

Created on 15 Sep 2020  路  3Comments  路  Source: libvips/libvips

Describe the bug
I can't compile libvips when I install libde265-dev libheif-dev libraries

To Reproduce
Steps to reproduce the behavior:

  1. insteall libde265-dev libheif-dev
  2. compile latest 8.10.1 libvips
  3. See error

Expected behavior
it compile

Actual behavior
it fail

make[3]: Entering directory '/vips-8.10.1/libvips/foreign'
depbase=`echo heifload.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/bash ../../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I../..  -I../../libvips/include -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS    -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include         -I/usr/include/libpng16  -I/usr/include/libexif                      -g -O2 -MT heifload.lo -MD -MP -MF $depbase.Tpo -c -o heifload.lo heifload.c &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../.. -I../../libvips/include -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libpng16 -I/usr/include/libexif -g -O2 -MT heifload.lo -MD -MP -MF .deps/heifload.Tpo -c heifload.c  -fPIC -DPIC -o .libs/heifload.o
heifload.c: In function 'vips_foreign_load_heif_build':
heifload.c:224:11: warning: implicit declaration of function 'heif_context_read_from_reader'; did you mean 'heif_context_read_from_memory'? [-Wimplicit-function-declaration]
   error = heif_context_read_from_reader( heif->ctx,
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           heif_context_read_from_memory
heifload.c:224:9: error: incompatible types when assigning to type 'struct heif_error' from type 'int'
   error = heif_context_read_from_reader( heif->ctx,
         ^
heifload.c: At top level:
heifload.c:952:1: error: return type is an incomplete type
 vips_foreign_load_heif_wait_for_file_size( gint64 target_size, void *userdata )
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
heifload.c: In function 'vips_foreign_load_heif_wait_for_file_size':
heifload.c:956:31: error: storage size of 'status' isn't known
  enum heif_reader_grow_status status;
                               ^~~~~~
heifload.c:962:12: error: 'heif_reader_grow_status_size_reached' undeclared (first use in this function); did you mean 'heif_reader_grow_status'?
   status = heif_reader_grow_status_size_reached;
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            heif_reader_grow_status
heifload.c:962:12: note: each undeclared identifier is reported only once for each function it appears in
heifload.c:970:12: error: 'heif_reader_grow_status_size_beyond_eof' undeclared (first use in this function); did you mean 'heif_reader_grow_status_size_reached'?
   status = heif_reader_grow_status_size_beyond_eof;
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            heif_reader_grow_status_size_reached
heifload.c:972:8: warning: 'return' with a value, in function returning void
  return( status );
        ^
heifload.c:952:1: note: declared here
 vips_foreign_load_heif_wait_for_file_size( gint64 target_size, void *userdata )
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../libvips/include/vips/vips.h:130:0,
                 from heifload.c:67:
heifload.c: In function 'vips_foreign_load_heif_init':
heifload.c:981:38: error: invalid application of 'sizeof' to incomplete type 'struct heif_reader'
  heif->reader = VIPS_ARRAY( NULL, 1, struct heif_reader );
                                      ^
../../libvips/include/vips/memory.h:65:56: note: in definition of macro 'VIPS_ARRAY'
  ((T *) vips_malloc( VIPS_OBJECT( OBJ ), (N) * sizeof( T )))
                                                        ^
heifload.c:985:14: error: dereferencing pointer to incomplete type 'struct heif_reader'
  heif->reader->reader_api_version = 1;
              ^~
Makefile:695: recipe for target 'heifload.lo' failed
make[3]: Leaving directory '/vips-8.10.1/libvips/foreign'
make[3]: *** [heifload.lo] Error 1
Makefile:875: recipe for target 'all-recursive' failed
make[2]: Leaving directory '/vips-8.10.1/libvips'
make[2]: *** [all-recursive] Error 1
Makefile:629: recipe for target 'all-recursive' failed
make[1]: Leaving directory '/vips-8.10.1'
make[1]: *** [all-recursive] Error 1
Makefile:536: recipe for target 'all' failed
make: *** [all] Error 2
The command '/bin/sh -c wget https://github.com/libvips/libvips/releases/download/v${VIPS_VERSION}/vips-${VIPS_VERSION}.tar.gz     && tar -xf vips-${VIPS_VERSION}.tar.gz     && cd vips-${VIPS_VERSION}     && ./configure     && make && make install && ldconfig' returned a non-zero code: 2 

Environment
Docker / ubuntu 18

Here a part of my Dockerfile

RUN apt-get -qq update && apt-get -qqy install vim zlib1g-dev libreadline-dev \
    libncurses5-dev libpcre3-dev libssl-dev gcc perl make curl git-core curl \
    luarocks libsass-dev glib2.0-dev libexpat1-dev \
    libjpeg-dev libwebp-dev libpng-dev libexif-dev libgif-dev \
    libde265-dev libheif-dev

ARG VIPS_VERSION=8.10.1

RUN wget https://github.com/libvips/libvips/releases/download/v${VIPS_VERSION}/vips-${VIPS_VERSION}.tar.gz \
    && tar -xf vips-${VIPS_VERSION}.tar.gz \
    && cd vips-${VIPS_VERSION} \
    && ./configure \
    && make && make install && ldconfig
bug

All 3 comments

Ubuntu 18.04 provides libheif v1.1.0 but heif_context_read_from_reader was added in libheif v1.3.0.

@jcupitt Perhaps we should make libheif v1.3.0 (June 2018) the minimum required version? There have been so many bug and more importantly security fixes to libheif since v1.1.0.

That sounds like a good idea @lovell. Let's raise the minimum for 8.10.2.

@solisoft you'll need to build libheif yourself, sorry. But as Lovell says, you probably shouldn't use the one in Ubuntu18.04 anyway, so perhaps it's a good thing.

OK, this change will be in 8.10.2. Thank you for the report @solisoft !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BorntraegerMarc picture BorntraegerMarc  路  3Comments

AKlein920 picture AKlein920  路  3Comments

Kyle-Kyle picture Kyle-Kyle  路  4Comments

harukizaemon picture harukizaemon  路  4Comments

volkan picture volkan  路  5Comments