解决 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

 

posted @ 2019-08-02 14:23  Hongkai_Ding  阅读(16323)  评论(0编辑  收藏  举报