gpt4 book ai didi

c++ - ldd找不到库

转载 作者:行者123 更新时间:2023-11-28 05:10:57 26 4
gpt4 key购买 nike

我已经读过 this , thisthis .

我已经将 OpenCV 安装在一个通用路径 /home/luca/ParallelOpenCV/install_icpc/lib 中,其中有 libopencv_core.so:

luca@jarvis:~$ ldd /home/luca/ParallelOpenCV/install_icpc/lib/libopencv_core.so
linux-vdso.so.1 => (0x00007ffccb389000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f46af719000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f46af410000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f46af1f2000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f46aefea000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f46aedd0000)
libimf.so => /opt/intel/compilers_and_libraries_2017.1.132/linux/compiler/lib/intel64/libimf.so (0x00007f46ae8e3000)
libsvml.so => /opt/intel/compilers_and_libraries_2017.1.132/linux/compiler/lib/intel64/libsvml.so (0x00007f46ad9d8000)
libirng.so => /opt/intel/compilers_and_libraries_2017.1.132/linux/compiler/lib/intel64/libirng.so (0x00007f46ad663000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f46ad2e0000)
libiomp5.so => /opt/intel/compilers_and_libraries_2017.1.132/linux/compiler/lib/intel64/libiomp5.so (0x00007f46acf3d000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f46acd27000)
libintlc.so.5 => /opt/intel/compilers_and_libraries_2017.1.132/linux/compiler/lib/intel64/libintlc.so.5 (0x00007f46acabc000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f46ac6f3000)
/lib64/ld-linux-x86-64.so.2 (0x000055f67574e000)

我将路径添加到 LD_LIBRARY_PATH 并执行了 ldconfig,但是:

luca@jarvis:~$ ldd libopencv_core.so
ldd: ./libopencv_core.so: No such file or directory

我错过了什么?

最佳答案

来自 man ldd:-

NAME

ldd - print shared object dependencies
SYNOPSIS top

ldd [option]... file...
DESCRIPTION

ldd prints the shared objects (shared libraries) required by each
program or shared object specified on the command line. An example
of its use and output is the following:

$ ldd /bin/ls
linux-vdso.so.1 (0x00007ffcc3563000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f87e5459000)
libcap.so.2 => /lib64/libcap.so.2 (0x00007f87e5254000)
libc.so.6 => /lib64/libc.so.6 (0x00007f87e4e92000)
libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f87e4c22000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f87e4a1e000)
/lib64/ld-linux-x86-64.so.2 (0x00005574bf12e000)
libattr.so.1 => /lib64/libattr.so.1 (0x00007f87e4817000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f87e45fa000)

命令的输出:

luca@jarvis:~$ ldd libopencv_core.so
ldd: ./libopencv_core.so: No such file or directory

程序或共享对象应该指定在隐含目录中不存在命令行 = ./ = /home/luca。我们知道它存在于 /home/luca/ParallelOpenCV/install_icpc/lib 中。

如果您运行 ldd file,其中 file 在 shell 扩展之后是路径名现有文件,然后 ldd 将显示动态依赖项该文件,由动态链接器发现并通常依赖于当前的 ldconfig 配置及其对操作的通常关注LD_LIBRARY_PATH 环境设置。它不会搜索您的系统对于可能是不存在的文件的备选文件并显示这些候选人的动态依赖关系。

关于c++ - ldd找不到库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43516242/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com