解决 Ubuntu16.04 + opencv4.1 源码编译错误 Makefile:160: recipe for target 'all' failed


 

最近源码编译 opencv,出现下面的错误

[ 60%] Built target opencv_dnn
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2

 

google 一下,才知道原来是安装了 Anaconda 后,python 和 gcc 都用的是 anaconda 的版本,anaconda 的 gcc 版本,比 system defalut 的版本低

参考:https://stackoverflow.com/questions/40322301/compile-opencv-3-on-ubuntu-16-04-linking-error-usr-lib-x86-64-linux-gnu-libsox

 

解决方案:

 

1. 在 shell 中先注释 Anaconda 的环境变量

# export PATH=~/anaconda3/bin:$PATH

 

2. cmake 添加选项

-D WITH_OPENMP=ON

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM