我在寻找为什么这个库(matio)在我的电脑上无法工作。在我的Makefile文件中,我有以下代码:
LIBS += -L/home/brian/.../matio-1.5.6/src/.libs/ -lmatio
当我尝试运行我的代码(链接良好)时,出现以下错误:
``` error while loading shared libraries: libmatio.so.4: cannot open shared object file: No such file or directory ```
使用-L标志指定的目录中存在libmatio.so.4。
我已经构建了该库,并且似乎只有少量编写错误通过了make check(这很好,因为我只需要它用于读取)。
我尝试过以下方法:
- 指定名称(即-l:libmatio.so.4.0.2) - 将路径添加到LD_LIBRARY_PATH中 - 在/etc/ld.so.conf中添加路径并运行sudo ldconfig - 在/etc/ld.so.conf.d中添加一个新文件,其中包含路径并运行sudo ldconfig
(当我运行ldconfig -p | grep matio时,没有返回任何内容。我在ldconfig方面做错了什么吗?)