linux opencv编译失败,linux环境下安装opencv (c++) 编译undefined reference错误的解决办法...

在Linux环境中尝试编译OpenCV时遇到链接错误,问题指向libhdf5.so.103未找到。这通常是因为系统缺少HDF5库或者版本不匹配。为解决此问题,需要确保已安装正确的HDF5库,并更新链接路径或使用-rpath-link选项重新编译。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

$ 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 toH5Fcreate'

/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 toH5Tget_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 toH5Tget_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 toH5Dopen2'

/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 toH5Sset_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 toH5

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值