Link errors with undefined reference to TIFF

这篇博客主要讨论了遇到编译错误'undefined reference to TIFF'的问题,该错误是由于Anaconda安装与Caffe编译时的Python路径不一致导致的。解决方案是注释掉~/.bashrc文件中Anaconda添加的路径。
Python3.9

Python3.9

Conda
Python

Python 是一种高级、解释型、通用的编程语言,以其简洁易读的语法而闻名,适用于广泛的应用,包括Web开发、数据分析、人工智能和自动化脚本

#Link errors with undefined reference to TIFF

具体报错如下:

System: Ubuntu 16.04 LTS
Any version of ViSP

During ViSP build you may encounter the following build issues:

$ cd visp-build
$ cmake ../visp
$ make
...
[ 12%] Linking CXX executable testIoPPM
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to `TIFFIsTiled@LIBTIFF_4.0'
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to `TIFFOpen@LIBTIFF_4.0'
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to `TIFFReadEncodedStrip@LIBTIFF_4.0'
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to `TIFFSetField@LIBTIFF_4.0'
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to `TIFFWriteScanline@LIBTIFF_4.0'
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to `TIFFGetField@LIBTIFF_4.0'
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to `TIFFScanlineSize@LIBTIFF_4.0'
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to `TIFFSetWarningHandler@LIBTIFF_4.0'
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to `TIFFSetErrorHandler@LIBTIFF_4.0'
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to `TIFFReadEncodedTile@LIBTIFF_4.0'
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to `TIFFReadRGBATile@LIBTIFF_4.0'
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to `TIFFClose@LIBTIFF_4.0'
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to `TIFFRGBAImageOK@LIBTIFF_4.0'
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to `TIFFReadRGBAStrip@LIBTIFF_4.0'
collect2: error: ld returned 1 exit status

解决办法如下:
这里写图片描述
主要是因为安装了Anaconda, 与caffe编译默认的python路径不符,需要注释~/.bashrc文件里面最后一行在安装Anaconda时添加的路径:

#export PATH="/home/user/anaconda2/bin:$PATH"

您可能感兴趣的与本文相关的镜像

Python3.9

Python3.9

Conda
Python

Python 是一种高级、解释型、通用的编程语言,以其简洁易读的语法而闻名,适用于广泛的应用,包括Web开发、数据分析、人工智能和自动化脚本

我在编译ocs2的时候出现 Errors << ocs2_anymal_mpc:make /home/ikun/logs/ocs2_anymal_mpc/build.make.004.log /usr/bin/ld: /lib/libgdal.so.26: undefined reference to `TIFFReadRGBATileExt@LIBTIFF_4.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference to `TIFFReadRGBATileExt@LIBTIFF_4.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference to `TIFFReadRGBAStripExt@LIBTIFF_4.0' /usr/bin/ld: /lib/libgdal.so.26: undefined reference to `TIFFReadRGBAStripExt@LIBTIFF_4.0' collect2: error: ld returned 1 exit status collect2: error: ld returned 1 exit status make[2]: *** [CMakeFiles/ocs2_anymal_mpc_dummy_mrt_node.dir/build.make:238: /home/ikun/ocs2_ws/devel/.private/ocs2_anymal_mpc/lib/ocs2_anymal_mpc/ocs2_anymal_mpc_dummy_mrt_node] Error 1 make[1]: *** [CMakeFiles/Makefile2:2915: CMakeFiles/ocs2_anymal_mpc_dummy_mrt_node.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... make[2]: *** [CMakeFiles/ocs2_anymal_mpc_mpc_node.dir/build.make:238: /home/ikun/ocs2_ws/devel/.private/ocs2_anymal_mpc/lib/ocs2_anymal_mpc/ocs2_anymal_mpc_mpc_node] Error 1 make[1]: *** [CMakeFiles/Makefile2:2803: CMakeFiles/ocs2_anymal_mpc_mpc_node.dir/all] Error 2 make: *** [Makefile:146: all] Error 2 cd /home/ikun/ocs2_ws/build/ocs2_anymal_mpc; catkin build --get-env ocs2_anymal_mpc | catkin env -si /usr/bin/make --jobserver-auth=3,4; cd - ................................................................................................................................................................................................................................................................................. Failed << ocs2_anymal_mpc:make [ Exited with code 2 ] Failed <<< ocs2_anymal_mpc [ 0.4 seconds ] Abandoned <<< ocs2 [ Unrelated job failed ] Abandoned <<< ocs2_anymal [ Unrelated job failed ] Abandoned <<< ocs2_mpcnet [ Unrelated job failed ] Abandoned <<< ocs2_robotic_examples [ Unrelated job failed ] Abandoned <<< ocs2_anymal_loopshaping_mpc [ Unrelated job failed ] Finished <<< ocs2_legged_robot_mpcnet [ 0.1 seconds ] [build] Summary: 68 of 74 packages succeeded. [build] Ignored: 9 packages were skipped or are skiplisted. [build] Warnings: 1 packages succeeded with warnings. [build] Abandoned: 5 packages were abandoned. [build] Failed: 1 packages failed. [build] Runtime: 5.0 seconds total.
最新发布
06-23
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值