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-processing/installing-opencv-3-1-0-on-ubuntu/), 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/vincentee/opencv_contrib/modules/hdf/include/opencv2/hdf.hpp:38,
from /home/vincentee/opencv/release/modules/hdf/precomp.hpp:42:
/usr/include/H5Gpublic.h:147:14: note: declared here
H5_DLL hid_t H5Gcreate1(hid_t loc_id, const char *name, size_t size_hint);
^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp: In member function ‘virtual std::vector<int> cv::hdf::HDF5Impl::dsgetsize(cv::String, int) const’:
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:294:72: error: too many arguments to function ‘hid_t H5Dopen1(hid_t, const char*)’
hid_t dsdata = H5Dopen( m_h5_file_id, dslabel.c_str(), H5P_DEFAULT );
^
In file included from /usr/include/hdf5.h:27: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/H5Dpublic.h:145:14: note: declared here
H5_DLL hid_t H5Dopen1(hid_t file_id, const char *name);
^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp: In member function ‘virtual int cv::hdf::HDF5Impl::dsgettype(cv::String) const’:
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:325:72: error: too many arguments to function ‘hid_t H5Dopen1(hid_t, const char*)’
hid_t dsdata = H5Dopen( m_h5_file_id, dslabel.c_str(), H5P_DEFAULT );
^
In file included from /usr/include/hdf5.h:27: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/H5Dpublic.h:145:14: note: declared here
H5_DLL hid_t H5Dopen1(hid_t file_id, const char *name);
^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:335:41: error: too few arguments to function ‘int H5Tget_array_dims1(hid_t, hsize_t*, int*)’
H5Tget_array_dims( dstype, ardims );
^
In file included from /usr/include/H5Lpublic.h:32:0,
from /usr/include/H5Opublic.h:33,
from /usr/include/H5Apublic.h:24,
from /usr/include/hdf5.h:25,
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/H5Tpublic.h:612:12: note: declared here
H5_DLL int H5Tget_array_dims1(hid_t type_id, hsize_t dims[], int perm[]);
^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp: In member function ‘virtual void cv::hdf::HDF5Impl::dscreate(int, const int*, int, cv::String, int, const int*) const’:
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:443:35: warning: narrowing conversion of ‘channs’ from ‘int’ to ‘hsize_t {aka long long unsigned int}’ inside { } is ill-formed in C++11 [-Wnarrowing]
hsize_t adims[1] = { channs };
^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:444:50: error: too few arguments to function ‘hid_t H5Tarray_create1(hid_t, int, const hsize_t*, const int*)’
dstype = H5Tarray_create( dstype, 1, adims );
^
In file included from /usr/include/H5Lpublic.h:32:0,
from /usr/include/H5Opublic.h:33,
from /usr/include/H5Apublic.h:24,
from /usr/include/hdf5.h:25,
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/H5Tpublic.h:609:14: note: declared here
H5_DLL hid_t H5Tarray_create1(hid_t base_id, int ndims,
^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:449:57: error: too many arguments to function ‘hid_t H5Dcreate1(hid_t, const char*, hid_t, hid_t, hid_t)’
dspace, H5P_DEFAULT, dsdcpl, H5P_DEFAULT );
^
In file included from /usr/include/hdf5.h:27: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/H5Dpublic.h:143:14: note: declared here
H5_DLL hid_t H5Dcreate1(hid_t file_id, const char *name, hid_t type_id,
^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp: In member function ‘virtual void cv::hdf::HDF5Impl::dsread(cv::OutputArray, cv::String, const int*, const int*) const’:
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:475:72: error: too many arguments to function ‘hid_t H5Dopen1(hid_t, const char*)’
hid_t dsdata = H5Dopen( m_h5_file_id, dslabel.c_str(), H5P_DEFAULT );
^
In file included from /usr/include/hdf5.h:27: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/H5Dpublic.h:145:14: note: declared here
H5_DLL hid_t H5Dopen1(hid_t file_id, const char *name);
^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:485:41: error: too few arguments to function ‘int H5Tget_array_dims1(hid_t, hsize_t*, int*)’
H5Tget_array_dims( dstype, ardims );
^
In file included from /usr/include/H5Lpublic.h:32:0,
from /usr/include/H5Opublic.h:33,
from /usr/include/H5Apublic.h:24,
from /usr/include/hdf5.h:25,
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/H5Tpublic.h:612:12: note: declared here
H5_DLL int H5Tget_array_dims1(hid_t type_id, hsize_t dims[], int perm[]);
^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp: In member function ‘virtual void cv::hdf::HDF5Impl::dswrite(cv::InputArray, cv::String, const int*, const int*) const’:
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:605:72: error: too many arguments to function ‘hid_t H5Dopen1(hid_t, const char*)’
hid_t dsdata = H5Dopen( m_h5_file_id, dslabel.c_str(), H5P_DEFAULT );
^
In file included from /usr/include/hdf5.h:27: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/H5Dpublic.h:145:14: note: declared here
H5_DLL hid_t H5Dopen1(hid_t file_id, const char *name);
^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:628:35: warning: narrowing conversion of ‘channs’ from ‘int’ to ‘hsize_t {aka long long unsigned int}’ inside { } is ill-formed in C++11 [-Wnarrowing]
hsize_t adims[1] = { channs };
^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:629:50: error: too few arguments to function ‘hid_t H5Tarray_create1(hid_t, int, const hsize_t*, const int*)’
dstype = H5Tarray_create( dstype, 1, adims );
^
In file included from /usr/include/H5Lpublic.h:32:0,
from /usr/include/H5Opublic.h:33,
from /usr/include/H5Apublic.h:24,
from /usr/include/hdf5.h:25,
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/H5Tpublic.h:609:14: note: declared here
H5_DLL hid_t H5Tarray_create1(hid_t base_id, int ndims,
^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp: In member function ‘virtual void cv::hdf::HDF5Impl::dsinsert(cv::InputArray, cv::String, const int*, const int*) const’:
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:690:72: error: too many arguments to function ‘hid_t H5Dopen1(hid_t, const char*)’
hid_t dsdata = H5Dopen( m_h5_file_id, dslabel.c_str(), H5P_DEFAULT );
^
In file included from /usr/include/hdf5.h:27: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/H5Dpublic.h:145:14: note: declared here
H5_DLL hid_t H5Dopen1(hid_t file_id, const char *name);
^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:746:35: warning: narrowing conversion of ‘channs’ from ‘int’ to ‘hsize_t {aka long long unsigned int}’ inside { } is ill-formed in C++11 [-Wnarrowing]
hsize_t adims[1] = { channs };
^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:747:50: error: too few arguments to function ‘hid_t H5Tarray_create1(hid_t, int, const hsize_t*, const int*)’
dstype = H5Tarray_create( dstype, 1, adims );
^
In file included from /usr/include/H5Lpublic.h:32:0,
from /usr/include/H5Opublic.h:33,
from /usr/include/H5Apublic.h:24,
from /usr/include/hdf5.h:25,
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/H5Tpublic.h:609:14: note: declared here
H5_DLL hid_t H5Tarray_create1(hid_t base_id, int ndims,
^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp: In member function ‘virtual void cv::hdf::HDF5Impl::kpcreate(int, cv::String, int, int) const’:
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:841:57: error: too many arguments to function ‘hid_t H5Dcreate1(hid_t, const char*, hid_t, hid_t, hid_t)’
dspace, H5P_DEFAULT, dsdcpl, H5P_DEFAULT );
^
In file included from /usr/include/hdf5.h:27: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/H5Dpublic.h:143:14: note: declared here
H5_DLL hid_t H5Dcreate1(hid_t file_id, const char *name, hid_t type_id,
^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp: In member function ‘virtual void cv::hdf::HDF5Impl::kpwrite(std::vector<cv::KeyPoint>, cv::String, int, int) const’:
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:869:72: error: too many arguments to function ‘hid_t H5Dopen1(hid_t, const char*)’
hid_t dsdata = H5Dopen( m_h5_file_id, kplabel.c_str(), H5P_DEFAULT );
^
In file included from /usr/include/hdf5.h:27: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/H5Dpublic.h:145:14: note: declared here
H5_DLL hid_t H5Dopen1(hid_t file_id, const char *name);
^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp: In member function ‘virtual void cv::hdf::HDF5Impl::kpinsert(std::vector<cv::KeyPoint>, cv::String, int, int) const’:
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:923:72: error: too many arguments to function ‘hid_t H5Dopen1(hid_t, const char*)’
hid_t dsdata = H5Dopen( m_h5_file_id, kplabel.c_str(), H5P_DEFAULT );
^
In file included from /usr/include/hdf5.h:27: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/H5Dpublic.h:145:14: note: declared here
H5_DLL hid_t H5Dopen1(hid_t file_id, const char *name);
^
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp: In member function ‘virtual void cv::hdf::HDF5Impl::kpread(std::vector<cv::KeyPoint>&, cv::String, int, int) const’:
/home/vincentee/opencv_contrib/modules/hdf/src/hdf5.cpp:990:72: error: too many arguments to function ‘hid_t H5Dopen1(hid_t, const char*)’
hid_t dsdata = H5Dopen( m_h5_file_id, kplabel.c_str(), H5P_DEFAULT );
^
In file included from /usr/include/hdf5.h:27: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/H5Dpublic.h:145:14: note: declared here
H5_DLL hid_t H5Dopen1(hid_t file_id, const char *name);
^
make[2]: *** [modules/hdf/CMakeFiles/opencv_hdf.dir/src/hdf5.cpp.o] Error 1
make[1]: *** [modules/hdf/CMakeFiles/opencv_hdf.dir/all] Error 2
make: *** [all] Error 2
However, I check my hdf5 library using dpkg -l | grep hdf5
, it is 1.8.4 version:
ii libhdf5-mpich-1.8.4 1.8.4-patch1-3ubuntu2 Hierarchical Data Format 5 (HDF5) - runtime files - MPICH version
ii libhdf5-mpich-dev 1.8.4-patch1-3ubuntu2 Hierarchical Data Format 5 (HDF5) - development files - MPICH version
rc libhdf5-serial-1.8.4
I'm using ubuntu 12.04 system, my gcc/g++ version is 4.8.1, Linux kernel version is 3.13.0-32-generic. Anyone know the problem?