caffe编译:libopencv_highgui.so:undefined reference to `[email protected]_4.0’ ‘[email protected]_1.

1. 环境:

Ubuntu16.04, opencv2.49, anaconda3, python3且以前编译成功过caffe

2. 出错现象:

/usr/lib/x86_64-linux-gnu/libopencv_highgui.so:undefined reference to `[email protected]_4.0’
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so:undefined reference to ‘[email protected]_1.
如下图:
caffe编译:libopencv_highgui.so:undefined reference to `[email protected]_4.0’ ‘[email protected]_1.
caffe编译:libopencv_highgui.so:undefined reference to `[email protected]_4.0’ ‘[email protected]_1.

3. 网上用过的方法小结:

1.在cmake 编译OpenCV时: cmake -D BUILD_TIFF=ON, 便会自动编译libtiff4,然后再以OpenCV做接口编译时,Bug消除!
2.使用sudo命令编译
3. 使用sudo apt-get install libtiff4-dev更新库等方法。

4.解决方法:

奈何网上的许多方法在的电脑环境下都没有用。根据现象,这是库依赖问题的可能性很大。于是在电脑中全局搜索了一下,发下我电脑本身/usr/带有这两个库,anaconda3下面也有这两个库,且在我的Makefileconfig下,这两个路径都被添加了。所有怀疑多个版本之间冲突(连接器:我TM怎么知道选谁,感觉都很优秀啊!)
所以呢,我就将anaconda3下面的libtiff, libuuid给干掉了

conda list | grep libtiff
conda remove libtiff
conda list | grep libuuid
conda remove libuuid

最终在我电脑环境中,编译通过了
caffe编译:libopencv_highgui.so:undefined reference to `[email protected]_4.0’ ‘[email protected]_1.