Building OpenCV 3.1 error in hdf5.cpp

asked 2016-04-09 01:59:34 -0600

vincentweisen gravatar image

I'm going to install the OpenCV 3.1 version in my ubuntu 12.04 laptop. I follow every step in this article (http://embedonix.com/articles/image-p...), but I'm getting some error in "make" command:

[ 21%] Building CXX object modules/hdf/CMakeFiles/opencv_hdf.dir/src/hdf5.cpp.o
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp: In constructor ‘cv::hdf::HDF5Impl::HDF5Impl(cv::String)’:
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:229:46: error: invalid conversion from ‘hid_t {aka int}’ to ‘herr_t (**)(void*) {aka int (**)(void*)}’ [-fpermissive]
     H5Eget_auto( stackid, &errfunc, &errdata );
                                              ^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:229:46: error: invalid conversion from ‘herr_t (**)(hid_t, void*) {aka int (**)(int, void*)}’ to ‘void**’ [-fpermissive]
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:229:46: error: too many arguments to function ‘herr_t H5Eget_auto1(herr_t (**)(void*), void**)’
In file included from /usr/include/hdf5.h:28:0,
                 from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf/hdf5.hpp:40,
                 from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf.hpp:38,
                 from /home/vincentee/opencv/release/modules/hdf/precomp.hpp:42:
/usr/include/H5Epublic.h:212:15: note: declared here
 H5_DLL herr_t H5Eget_auto1(H5E_auto1_t *func, void **client_data);
               ^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:232:38: error: invalid conversion from ‘hid_t {aka int}’ to ‘H5E_auto1_t {aka int (*)(void*)}’ [-fpermissive]
     H5Eset_auto( stackid, NULL, NULL );
                                      ^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:232:38: error: too many arguments to function ‘herr_t H5Eset_auto1(H5E_auto1_t, void*)’
In file included from /usr/include/hdf5.h:28:0,
                 from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf/hdf5.hpp:40,
                 from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf.hpp:38,
                 from /home/vincentee/opencv/release/modules/hdf/precomp.hpp:42:
/usr/include/H5Epublic.h:216:15: note: declared here
 H5_DLL herr_t H5Eset_auto1(H5E_auto1_t func, void *client_data);
               ^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:238:44: error: invalid conversion from ‘hid_t {aka int}’ to ‘H5E_auto1_t {aka int (*)(void*)}’ [-fpermissive]
     H5Eset_auto( stackid, errfunc, errdata );
                                            ^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:238:44: error: invalid conversion from ‘H5E_auto2_t {aka int (*)(int, void*)}’ to ‘void*’ [-fpermissive]
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:238:44: error: too many arguments to function ‘herr_t H5Eset_auto1(H5E_auto1_t, void*)’
In file included from /usr/include/hdf5.h:28:0,
                 from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf/hdf5.hpp:40,
                 from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf.hpp:38,
                 from /home/vincentee/opencv/release/modules/hdf/precomp.hpp:42:
/usr/include/H5Epublic.h:216:15: note: declared here
 H5_DLL herr_t H5Eset_auto1(H5E_auto1_t func, void *client_data);
               ^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp: In member function ‘virtual void cv::hdf::HDF5Impl::grcreate(cv::String)’:
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:283:54: error: too many arguments to function ‘hid_t H5Gcreate1(hid_t, const char*, size_t)’
                 H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
                                                      ^
In file included from /usr/include/hdf5.h:31:0,
                 from /home/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf/hdf5.hpp:40,
                 from /home ...
(more)
edit retag flag offensive close merge delete

Comments

  • do you need the hdf5 module ? (else, you could disable it for now, cmake -DBUILD_opencv_hdf=OFF)
  • there seems to be a mismatch between your hdf version, and the one, th author (@cbalint13) is using. if we can't clarify this from here, it might be a good idea to report there
berak gravatar imageberak ( 2016-04-09 02:16:55 -0600 )edit

Thanks. It skip through the error, but have another error here:

../../lib/libopencv_videoio.so.3.1.0: undefined reference to `gp_camera_autodetect'

collect2: error: ld returned 1 exit status

make[2]: * [bin/opencv_perf_video] Error 1

make[1]: * [modules/video/CMakeFiles/opencv_perf_video.dir/all] Error 2

make: * [all] Error 2

vincentweisen gravatar imagevincentweisen ( 2016-04-09 03:25:49 -0600 )edit