make matcaffe是OK的,但是make mattest 会出现类似这种:undefined symbol:_ZN2cv8imencodeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS_11_InputArrayERSt6vectorIhSaIhEERKSB_IiSaIiEE 一大堆乱字符.
解决方案:sudo gedit ~/.bashrc
在最后加入:
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4:/usr/lib/x86_64-linux-gnu/libopencv_imgproc.so.2.4:/usr/lib/x86_64-linux-gnu/libopencv_core.so.2.4:/usr/lib/x86_64-linux-gnu/libstdc++.so.6:/usr/lib/x86_64-linux-gnu/libfreetype.so.6
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/
最后保存好 source ~/.bashrc
重新编译下就可以OK了