gpt4 book ai didi

g++ - 修复共享库 g++ 上的断开链接

转载 作者:行者123 更新时间:2023-12-01 23:34:51 46 4
gpt4 key购买 nike

我有一个链接到 opencv 2.2 的可执行文件。但是,我删除了 opencv 2.2 并安装了 opencv 2.3。

问题是,有没有办法在不重新编译整个源代码的情况下将这个可执行文件链接到新的共享库?我该如何修复这些断开的链接?

running ldd:

linux-vdso.so.1 => (0x00007fff17fff000)
libSM.so.6 => /usr/lib/x86_64-linux-gnu/libSM.so.6 (0x00007fd6f0e0d000)
libICE.so.6 => /usr/lib/x86_64-linux-gnu/libICE.so.6 (0x00007fd6f0bf2000)
libXmu.so.6 => /usr/lib/libXmu.so.6 (0x00007fd6f09d8000)
libXi.so.6 => /usr/lib/x86_64-linux-gnu/libXi.so.6 (0x00007fd6f07c8000)
libGLU.so.1 => /usr/lib/libGLU.so.1 (0x00007fd6f0559000)
libGL.so.1 => /usr/lib/fglrx/libGL.so.1 (0x00007fd6f0353000)
libopencv_core.so.2.2 => not found
libopencv_imgproc.so.2.2 => not found
libopencv_highgui.so.2.2 => not found
libopencv_ml.so.2.2 => not found
libopencv_video.so.2.2 => not found
libopencv_features2d.so.2.2 => not found
libopencv_calib3d.so.2.2 => not found
libopencv_objdetect.so.2.2 => not found
libopencv_contrib.so.2.2 => not found
libopencv_legacy.so.2.2 => not found
libopencv_flann.so.2.2 => not found
libglut.so.3 => /usr/lib/libglut.so.3 (0x00007fd6f0109000)

...

谢谢大家,

塞缪尔

最佳答案

如果 OpenCV 2.3 版与 2.2 版二进制兼容,即如果 ABI没有进行重大更改,您可以使用 symbolic links 解决此问题:

# ln -s /usr/lib/libopencv_core.so.2.3 /usr/lib/libopencv_core.so.2.2
# ln -s /usr/lib/libopencv_imgproc.so.2.3 /usr/lib/libopencv_imgproc.so.2.2
.
.
.

关于g++ - 修复共享库 g++ 上的断开链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6975347/

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