链接错误与`libopencv_highgui.so`在Ubuntu 14.04下,奇怪的结果与`libtiff.so.5` [英] Linking error with `libopencv_highgui.so` under Ubuntu 14.04, strange result with `libtiff.so.5`

查看:4615
本文介绍了链接错误与`libopencv_highgui.so`在Ubuntu 14.04下,奇怪的结果与`libtiff.so.5`的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题



我正在编译深度学习库 Caffe Ubuntu 14.04(64位)。



OpenCV(版本:2.4.8 + dfsg1-2ubuntu1 ) ubuntu套件伺服器:


sudo apt-get install libopencv-dev


使用CMake 2.8编译 Caffe



链接错误:


链接CXX可执行文件caffe -



/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.8:未定义引用`TIFFOpen@LIBTIFF_4.0'




信息



似乎找不到TIFF库的一些符号。我做了一些努力找到原因(没有运气)。



libopencv_highgui.so.2.4.8链接的TIFF库


$ ldd libopencv_highgui.so.2.4.8 | grep tiff



libtiff.so.5 => /usr/lib/x86_64-linux-gnu/libtiff.so.5(0x00007f978313b000)


导入 libopencv_highgui.so.2.4.8 的符号


$ readelf -s libopencv_highgui.so.2.4.8 | grep TIFFOpen



62:0000000000000000 0 FUNC GLOBAL DEFAULT UND TIFFOpen@LIBTIFF_4.0(9)


>:在符号名称中只有一个 @


< D libopencv_highgui.so.2.4.8 | grep TIFFOpen



U TIFFOpen


导出符号 libtiff.so.5


$ nm -D / usr / lib / x86_64-linux-gnu / libtiff.so.5



0000000000000000 A LIBTIFF_4.0





00000000000429f0 T TIFFOpen



...



$ readelf -s /usr/lib/x86_64-linux-gnu/libtiff.so.5|grep TIFFOpen



99:00000000000429f0 239 FUNC GLOBAL DEFAULT 12 TIFFOpen @@ LIBTIFF_4.0


注意:有两个<$ c $



我的混淆

/ h1>


  1. 是因为 libtiff.so.5 $ @ $ ,而不是 @ >

    libopencv_highgui.so.2.4.8:未定义的引用TIFFIsTiled@LIBTIFF_4.0


  2. @ @@ 在符号名称中?

  3. 后缀 LIBTIFF_4的含义是什么? libtiff.so.5

  4. 的符号名称中有0 许多人说这是因为OpenCV需要 libtiff4-dev 这不是由Ubuntu 14.04提供。

  5. 如何解决链接问题?





我不是一个编译和链接的职业。对不起,这么长的职位。只是什么提供足够的信息,你们帮助我。
赞赏任何建议。



PS 如果您需要更多关于这些库的信息,请随意在评论中说。

解决方案

安装libtiff4-dev:



sudo apt-get install libtiff4-dev


Problem

I'm compiling the deep learning library Caffe in Ubuntu 14.04(64 bit).

OpenCV(Version: 2.4.8+dfsg1-2ubuntu1) is installed from ubuntu packages server with :

sudo apt-get install libopencv-dev

Compile Caffe with CMake 2.8.

Linking error:

Linking CXX executable caffe-

/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.8: undefined reference to `TIFFOpen@LIBTIFF_4.0'

Infomation

It seems some symbols of TIFF library were not found. I made some effort to find the reason(without luck). Here's some infomation about the libraries.

TIFF library linked by libopencv_highgui.so.2.4.8

$ ldd libopencv_highgui.so.2.4.8 | grep tiff

libtiff.so.5 => /usr/lib/x86_64-linux-gnu/libtiff.so.5 (0x00007f978313b000)

Import symbols of libopencv_highgui.so.2.4.8

$ readelf -s libopencv_highgui.so.2.4.8 |grep TIFFOpen

62: 0000000000000000 0 FUNC GLOBAL DEFAULT UND TIFFOpen@LIBTIFF_4.0 (9)

Note: There is one single @ in the symbol names.

$ nm -D libopencv_highgui.so.2.4.8| grep TIFFOpen

U TIFFOpen

Export symbols of libtiff.so.5:

$ nm -D /usr/lib/x86_64-linux-gnu/libtiff.so.5

0000000000000000 A LIBTIFF_4.0

...

00000000000429f0 T TIFFOpen

...

$ readelf -s /usr/lib/x86_64-linux-gnu/libtiff.so.5|grep TIFFOpen

99: 00000000000429f0 239 FUNC GLOBAL DEFAULT 12 TIFFOpen@@LIBTIFF_4.0

Note: There are two @(@@) in the symbol names.

My confusion

  1. Is it because libtiff.so.5 has @@ in the symbol names instead of @ that made the linking error

    libopencv_highgui.so.2.4.8: undefined reference to 'TIFFIsTiled@LIBTIFF_4.0'

  2. What's the difference between @ and @@ in symbol names?
  3. What's the meaning of the suffix LIBTIFF_4.0 of symbols names in libtiff.so.5?
  4. Many people said it's because OpenCV need libtiff4-dev which is not provided by Ubuntu 14.04. Then why the Ubuntu guys put a broken package on the package server.
  5. How to solve the linking problem?


I'm not a profession on compiling and linking. Sorry for such a long post. Just what to provide enough infomation for you guys to help me. Appreciate for any suggestions.

P.S. If you need more infomation of those libs, feel free to say in the comment.

解决方案

Install libtiff4-dev:

sudo apt-get install libtiff4-dev

这篇关于链接错误与`libopencv_highgui.so`在Ubuntu 14.04下,奇怪的结果与`libtiff.so.5`的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆