Skip to content
This repository was archived by the owner on Apr 29, 2025. It is now read-only.
This repository was archived by the owner on Apr 29, 2025. It is now read-only.

Compilation error with php7.4 #20

@benjy8001

Description

@benjy8001

Hi !

i have a compilation error with php-fpm 7.4 (see Dockerfile here => https://github.com/benjy8001/php-fpm-opencv/blob/master/7.4/Dockerfile)

Cloning into 'php-opencv'...
Configuring for:
PHP Api Version:         20190902
Zend Module Api No:      20190902
Zend Extension Api No:   320190902
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking pkg-config is at least version 0.9.0... yes
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-musl
checking host system type... x86_64-pc-linux-musl
checking target system type... x86_64-pc-linux-musl
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php7 -I/usr/include/php7/main -I/usr/include/php7/TSRM -I/usr/include/php7/Zend -I/usr/include/php7/ext -I/usr/include/php7/ext/date/lib
checking for PHP extension directory... /usr/lib/php7/modules
checking for PHP installed headers prefix... /usr/include/php7
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking if awk is broken... no
checking for opencv support... yes, shared
checking for php debug... no
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking for pkg-config... found
checking for opencv... found 4.5.0
checking for a sed that does not truncate output... /bin/sed
checking for ld used by cc... /usr/x86_64-alpine-linux-musl/bin/ld
checking if the linker (/usr/x86_64-alpine-linux-musl/bin/ld) is GNU ld... yes
checking for /usr/x86_64-alpine-linux-musl/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking how to run the C++ preprocessor... g++ -E
checking the maximum length of command line arguments... 98304
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/x86_64-alpine-linux-musl/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by g++... /usr/x86_64-alpine-linux-musl/bin/ld -m elf_x86_64
checking if the linker (/usr/x86_64-alpine-linux-musl/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/x86_64-alpine-linux-musl/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC
checking if g++ PIC flag -fPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/usr/x86_64-alpine-linux-musl/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
(cached) (cached) checking how to hardcode library paths into programs... immediate
configure: patching config.h.in
configure: creating ./config.status
config.status: creating config.h
/bin/sh /opt/php-opencv/libtool --mode=compile g++ -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/opt/php-opencv -DPHP_ATOM_INC -I/opt/php-opencv/include -I/opt/php-opencv/main -I/opt/php-opencv -I/usr/include/php7 -I/usr/include/php7/main -I/usr/include/php7/TSRM -I/usr/include/php7/Zend -I/usr/include/php7/ext -I/usr/include/php7/ext/date/lib -I/usr/local/include/opencv4  -DHAVE_CONFIG_H  -g -O2   -c /opt/php-opencv/opencv.cc -o opencv.lo 
mkdir .libs
 g++ -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/opt/php-opencv -DPHP_ATOM_INC -I/opt/php-opencv/include -I/opt/php-opencv/main -I/opt/php-opencv -I/usr/include/php7 -I/usr/include/php7/main -I/usr/include/php7/TSRM -I/usr/include/php7/Zend -I/usr/include/php7/ext -I/usr/include/php7/ext/date/lib -I/usr/local/include/opencv4 -DHAVE_CONFIG_H -g -O2 -c /opt/php-opencv/opencv.cc  -fPIC -DPIC -o .libs/opencv.o
/bin/sh /opt/php-opencv/libtool --mode=compile g++ -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/opt/php-opencv -DPHP_ATOM_INC -I/opt/php-opencv/include -I/opt/php-opencv/main -I/opt/php-opencv -I/usr/include/php7 -I/usr/include/php7/main -I/usr/include/php7/TSRM -I/usr/include/php7/Zend -I/usr/include/php7/ext -I/usr/include/php7/ext/date/lib -I/usr/local/include/opencv4  -DHAVE_CONFIG_H  -g -O2   -c /opt/php-opencv/source/opencv2/core/opencv_mat.cc -o source/opencv2/core/opencv_mat.lo 
mkdir source/opencv2/core/.libs
 g++ -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/opt/php-opencv -DPHP_ATOM_INC -I/opt/php-opencv/include -I/opt/php-opencv/main -I/opt/php-opencv -I/usr/include/php7 -I/usr/include/php7/main -I/usr/include/php7/TSRM -I/usr/include/php7/Zend -I/usr/include/php7/ext -I/usr/include/php7/ext/date/lib -I/usr/local/include/opencv4 -DHAVE_CONFIG_H -g -O2 -c /opt/php-opencv/source/opencv2/core/opencv_mat.cc  -fPIC -DPIC -o source/opencv2/core/.libs/opencv_mat.o
In file included from /usr/include/php7/Zend/zend.h:27,
                 from /usr/include/php7/main/php.h:33,
                 from /opt/php-opencv/source/opencv2/core/../../../php_opencv.h:23,
                 from /opt/php-opencv/source/opencv2/core/opencv_mat.cc:18:
/opt/php-opencv/source/opencv2/core/opencv_mat.cc: In function 'void opencv_mat_update_property_by_c_mat(zval*, cv::Mat*)':
/usr/include/php7/Zend/zend_types.h:663:38: error: cannot convert 'zend_object*' {aka '_zend_object*'} to 'zval*' {aka '_zval_struct*'}
  663 | #define Z_OBJ(zval)     (zval).value.obj
      |                         ~~~~~~~~~~~~~^~~
      |                                      |
      |                                      zend_object* {aka _zend_object*}
/usr/include/php7/Zend/zend_types.h:664:28: note: in expansion of macro 'Z_OBJ'
  664 | #define Z_OBJ_P(zval_p)    Z_OBJ(*(zval_p))
      |                            ^~~~~
/opt/php-opencv/source/opencv2/core/opencv_mat.cc:53:46: note: in expansion of macro 'Z_OBJ_P'
   53 |     zend_update_property_long(opencv_mat_ce, Z_OBJ_P(z), "rows", sizeof("rows")-1, mat->rows);
      |                                              ^~~~~~~
In file included from /usr/include/php7/main/php.h:37,
                 from /opt/php-opencv/source/opencv2/core/../../../php_opencv.h:23,
                 from /opt/php-opencv/source/opencv2/core/opencv_mat.cc:18:
/usr/include/php7/Zend/zend_API.h:339:72: note:   initializing argument 2 of 'void zend_update_property_long(zend_class_entry*, zval*, const char*, size_t, zend_long)'
  339 | ZEND_API void zend_update_property_long(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zend_long value);
      |                                                                  ~~~~~~^~~~~~
In file included from /usr/include/php7/Zend/zend.h:27,
                 from /usr/include/php7/main/php.h:33,
                 from /opt/php-opencv/source/opencv2/core/../../../php_opencv.h:23,
                 from /opt/php-opencv/source/opencv2/core/opencv_mat.cc:18:
/usr/include/php7/Zend/zend_types.h:663:38: error: cannot convert 'zend_object*' {aka '_zend_object*'} to 'zval*' {aka '_zval_struct*'}
  663 | #define Z_OBJ(zval)     (zval).value.obj
      |                         ~~~~~~~~~~~~~^~~
      |                                      |
      |                                      zend_object* {aka _zend_object*}
/usr/include/php7/Zend/zend_types.h:664:28: note: in expansion of macro 'Z_OBJ'
  664 | #define Z_OBJ_P(zval_p)    Z_OBJ(*(zval_p))
      |                            ^~~~~
/opt/php-opencv/source/opencv2/core/opencv_mat.cc:54:46: note: in expansion of macro 'Z_OBJ_P'
   54 |     zend_update_property_long(opencv_mat_ce, Z_OBJ_P(z), "cols", sizeof("cols")-1, mat->cols);
      |                                              ^~~~~~~
In file included from /usr/include/php7/main/php.h:37,
                 from /opt/php-opencv/source/opencv2/core/../../../php_opencv.h:23,
                 from /opt/php-opencv/source/opencv2/core/opencv_mat.cc:18:
/usr/include/php7/Zend/zend_API.h:339:72: note:   initializing argument 2 of 'void zend_update_property_long(zend_class_entry*, zval*, const char*, size_t, zend_long)'
  339 | ZEND_API void zend_update_property_long(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zend_long value);
      |                                                                  ~~~~~~^~~~~~
In file included from /usr/include/php7/Zend/zend.h:27,
                 from /usr/include/php7/main/php.h:33,
                 from /opt/php-opencv/source/opencv2/core/../../../php_opencv.h:23,
                 from /opt/php-opencv/source/opencv2/core/opencv_mat.cc:18:
/usr/include/php7/Zend/zend_types.h:663:38: error: cannot convert 'zend_object*' {aka '_zend_object*'} to 'zval*' {aka '_zval_struct*'}
  663 | #define Z_OBJ(zval)     (zval).value.obj
      |                         ~~~~~~~~~~~~~^~~
      |                                      |
      |                                      zend_object* {aka _zend_object*}
/usr/include/php7/Zend/zend_types.h:664:28: note: in expansion of macro 'Z_OBJ'
  664 | #define Z_OBJ_P(zval_p)    Z_OBJ(*(zval_p))
      |                            ^~~~~
/opt/php-opencv/source/opencv2/core/opencv_mat.cc:55:46: note: in expansion of macro 'Z_OBJ_P'
   55 |     zend_update_property_long(opencv_mat_ce, Z_OBJ_P(z), "dims", sizeof("dims")-1, mat->dims);
      |                                              ^~~~~~~
In file included from /usr/include/php7/main/php.h:37,
                 from /opt/php-opencv/source/opencv2/core/../../../php_opencv.h:23,
                 from /opt/php-opencv/source/opencv2/core/opencv_mat.cc:18:
/usr/include/php7/Zend/zend_API.h:339:72: note:   initializing argument 2 of 'void zend_update_property_long(zend_class_entry*, zval*, const char*, size_t, zend_long)'
  339 | ZEND_API void zend_update_property_long(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zend_long value);
      |                                                                  ~~~~~~^~~~~~
In file included from /usr/include/php7/Zend/zend.h:27,
                 from /usr/include/php7/main/php.h:33,
                 from /opt/php-opencv/source/opencv2/core/../../../php_opencv.h:23,
                 from /opt/php-opencv/source/opencv2/core/opencv_mat.cc:18:
/usr/include/php7/Zend/zend_types.h:663:38: error: cannot convert 'zend_object*' {aka '_zend_object*'} to 'zval*' {aka '_zval_struct*'}
  663 | #define Z_OBJ(zval)     (zval).value.obj
      |                         ~~~~~~~~~~~~~^~~
      |                                      |
      |                                      zend_object* {aka _zend_object*}
/usr/include/php7/Zend/zend_types.h:664:28: note: in expansion of macro 'Z_OBJ'
  664 | #define Z_OBJ_P(zval_p)    Z_OBJ(*(zval_p))
      |                            ^~~~~
/opt/php-opencv/source/opencv2/core/opencv_mat.cc:56:46: note: in expansion of macro 'Z_OBJ_P'
   56 |     zend_update_property_long(opencv_mat_ce, Z_OBJ_P(z), "type", sizeof("type")-1, mat->type());
      |                                              ^~~~~~~
In file included from /usr/include/php7/main/php.h:37,
                 from /opt/php-opencv/source/opencv2/core/../../../php_opencv.h:23,
                 from /opt/php-opencv/source/opencv2/core/opencv_mat.cc:18:
/usr/include/php7/Zend/zend_API.h:339:72: note:   initializing argument 2 of 'void zend_update_property_long(zend_class_entry*, zval*, const char*, size_t, zend_long)'
  339 | ZEND_API void zend_update_property_long(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zend_long value);
      |                                                                  ~~~~~~^~~~~~
In file included from /usr/include/php7/Zend/zend.h:27,
                 from /usr/include/php7/main/php.h:33,
                 from /opt/php-opencv/source/opencv2/core/../../../php_opencv.h:23,
                 from /opt/php-opencv/source/opencv2/core/opencv_mat.cc:18:
/usr/include/php7/Zend/zend_types.h:663:38: error: cannot convert 'zend_object*' {aka '_zend_object*'} to 'zval*' {aka '_zval_struct*'}
  663 | #define Z_OBJ(zval)     (zval).value.obj
      |                         ~~~~~~~~~~~~~^~~
      |                                      |
      |                                      zend_object* {aka _zend_object*}
/usr/include/php7/Zend/zend_types.h:664:28: note: in expansion of macro 'Z_OBJ'
  664 | #define Z_OBJ_P(zval_p)    Z_OBJ(*(zval_p))
      |                            ^~~~~
/opt/php-opencv/source/opencv2/core/opencv_mat.cc:66:45: note: in expansion of macro 'Z_OBJ_P'
   66 |         zend_update_property(opencv_mat_ce, Z_OBJ_P(z), "shape", sizeof("shape")-1, &shape_zval);
      |                                             ^~~~~~~
In file included from /usr/include/php7/main/php.h:37,
                 from /opt/php-opencv/source/opencv2/core/../../../php_opencv.h:23,
                 from /opt/php-opencv/source/opencv2/core/opencv_mat.cc:18:
/usr/include/php7/Zend/zend_API.h:336:67: note:   initializing argument 2 of 'void zend_update_property(zend_class_entry*, zval*, const char*, size_t, zval*)'
  336 | ZEND_API void zend_update_property(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zval *value);
      |                                                             ~~~~~~^~~~~~
/opt/php-opencv/source/opencv2/core/opencv_mat.cc: In function 'zval* opencv_mat_write_property(zend_object*, zend_string*, zval*, void**)':
/opt/php-opencv/source/opencv2/core/opencv_mat.cc:841:40: error: cannot convert 'zend_object*' {aka '_zend_object*'} to 'zval*' {aka '_zval_struct*'} in argument passing
  841 |     std_object_handlers.write_property(object,member,value,cache_slot);
      |                                        ^~~~~~
      |                                        |
      |                                        zend_object* {aka _zend_object*}
/opt/php-opencv/source/opencv2/core/opencv_mat.cc: In function 'void opencv_mat_init()':
/opt/php-opencv/source/opencv2/core/opencv_mat.cc:857:49: error: invalid conversion from 'zval* (*)(zend_object*, zend_string*, zval*, void**)' {aka '_zval_struct* (*)(_zend_object*, _zend_string*, _zval_struct*, void**)'} to 'zend_object_write_property_t' {aka 'void (*)(_zval_struct*, _zval_struct*, _zval_struct*, void**)'} [-fpermissive]
  857 |     opencv_mat_object_handlers.write_property = opencv_mat_write_property;
      |                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                 |
      |                                                 zval* (*)(zend_object*, zend_string*, zval*, void**) {aka _zval_struct* (*)(_zend_object*, _zend_string*, _zval_struct*, void**)}
make: *** [Makefile:194: source/opencv2/core/opencv_mat.lo] Error 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions