c++ makefile找不到hdf5的共享库

c++ makefile not finding shared library for hdf5

本文关键字:共享 hdf5 makefile 找不到 c++      更新时间:2023-10-16

我正在Kubuntu上编译一个c++程序,它将使用hdf5库。我已经安装了hdf5库使用

sudo apt-get install libhdf5-7
sudo apt-get install libhdf5-cpp-7

但是当我为程序运行makefile时,我得到

make[2]: *** No rule to make target '/usr/local/lib/libhdf5.so', needed by 'src/libHDF5Wrapper.so'.  Stop.

确实在/usr/lib中没有libhdf5* -文件。我在hdf5的安装中错过了什么吗?

为了结束这个问题,我把我的评论放在这个答案中:

库在Ubuntu上的正确位置可以通过使用相应包的在线文件列表或通过:

ldconfig -p | grep libhdf5.so

返回:

libhdf5.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libhdf5.so

您的makefile似乎错误地假设库的位置为/usr/local/lib,因此您需要调整makefile以匹配您计算机上的实际安装位置。