報錯信息
$ make [ 50%] Linking CXX executable DisplayImage /usr/bin/ld: warning: libhdf5.so.103, needed by /usr/lib/libopencv_hdf.so.4.1.1, not found (try using -rpath or -rpath-link) /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to H5Dread' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to
H5Fcreate' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to H5T_NATIVE_UCHAR_g' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to
H5Tget_size' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to H5check_version' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to
H5Tget_array_dims2' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to H5Tclose' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to
H5Dopen2' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to H5open' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to
H5Sset_extent_simple' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to H5T_NATIVE_INT32_g' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to
H5T_NATIVE_SCHAR_g' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to H5Screate_simple' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to
H5Aget_type' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to H5Tcreate' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to
H5Awrite' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to H5Fclose' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to
H5Tset_strpad' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to H5Gclose' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to
H5Aopen' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to H5Tget_class' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to
H5Gcreate2' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to H5Aread' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to
H5Dclose' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to H5Pset_deflate' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to
H5Adelete' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to H5P_CLS_DATASET_CREATE_ID_g' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to
H5Acreate2' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to H5Dget_create_plist' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to
H5Aopen_name' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to H5Eset_auto2' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to
H5Sselect_hyperslab' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to H5Pset_chunk' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to
H5Pget_layout' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to H5P_CLS_LINK_ACCESS_ID_g' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to
H5Pget_chunk' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to H5Tinsert' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to
H5Tequal' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to H5Dget_space' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to
H5Aget_space' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to H5Fis_hdf5' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to
H5Dget_type' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to H5T_NATIVE_FLOAT_g' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to
H5T_NATIVE_USHORT_g' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to H5Pcreate' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to
H5Eget_auto2' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to H5Aclose' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to
H5Tset_size' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to H5Tarray_create2' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to
H5Pclose' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to H5Sget_simple_extent_ndims' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to
H5Screate' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to H5Dwrite' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to
H5Dextend' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to H5Tget_super' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to
H5Tget_native_type' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to H5Lexists' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to
H5T_NATIVE_INT_g' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to H5T_C_S1_g' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to
H5Tcopy' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to H5Sclose' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to
H5T_NATIVE_SHORT_g' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to H5T_NATIVE_DOUBLE_g' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to
H5Sget_simple_extent_dims' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to H5Dcreate2' /usr/bin/ld: /usr/lib/libopencv_hdf.so.4.1.1: undefined reference to
H5Fopen' collect2: 錯誤:ld 返回 1 make[2]: *** [CMakeFiles/DisplayImage.dir/build.make:133:DisplayImage] 錯誤 1 make[1]: *** [CMakeFiles/Makefile2:76:CMakeFiles/DisplayImage.dir/all] 錯誤 2 make: *** [Makefile:84:all] 錯誤 2ui
解決方案
安裝軟件包: vtk hdf5 glew
url