Ubuntu下 /usr/bin/ld: cannot find -lcaffe 的解決辦法

根據https://blog.csdn.net/luozhichengaichenlei/article/details/104441935來安裝caffe

https://gitee.com/luo_zhi_cheng/retinaface_caffe項目中,使用make來編譯時用到了lcaffe.so,出現錯誤:/usr/bin/ld: cannot find -lcaffe

 

解決辦法參考:https://www.cnblogs.com/zhming26/p/6164131.html

1、將庫文件所在的路徑加入到 /etc/ld.so.conf 尾部,即複製 /home/lzc/Desktop/detection/caffe-ssd/caffe-ssd/build/lib 到 /etc/ld.so.conf 的最後一行,關閉之後 sudo ldconfig。

2、gedit ~/.bashrc 然後在最後添加 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/lzc/Desktop/detection/caffe-ssd/caffe-ssd/build/lib ,關閉之後 source ~/.bashrc

3、此時make應該可以成功,若不成功,則第二步換成 export LIBRARY_PATH=$LIBRARY_PATH:/home/lzc/Desktop/detection/caffe-ssd/caffe-ssd/build/lib 再試試。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章