修复共享库 g++ 上损坏的链接

发布于 2024-11-28 05:57:13 字数 1246 浏览 1 评论 0原文

我有一个链接到 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)

...

谢谢大家,

塞缪尔

I have an executable which links to opencv 2.2. However, I have removed opencv 2.2 and I have opencv 2.3 installed.

The question is, is there a way to link this executable to the new shared library without recompiling the whole source code? How can I fix those broken links?

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)

...

thanks guys,

Samuel

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

偷得浮生 2024-12-05 05:57:13

如果 OpenCV 版本 2.3 与版本 2.2 二进制兼容,即如果 ABI 没有进行重大更改,您可以使用符号链接解决该问题:

# 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
.
.
.

If OpenCV version 2.3 is binary compatible with version 2.2, i.e. if the ABI did not undergo breaking changes, you can work around the problem with 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
.
.
.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文