修复共享库 g++ 上损坏的链接
我有一个链接到 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果 OpenCV 版本 2.3 与版本 2.2 二进制兼容,即如果 ABI 没有进行重大更改,您可以使用符号链接解决该问题:
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: