Makefile:160: recipe for target ‘all’ failed (Ubuntu 16.06 + Opencv3.2) [Solved]

Preface

Opencv has been used well before. After anaconda is installed today, opencv in Python can’t be used, even after copying cv2.so. The problems are as follows:

Root cause

After installing anaconda, many of the default compilers have become included in anaconda, such as Python and GCC. Then the installation of Python in the system is useless. At first, I didn’t find this problem. In a rage, I unloaded OpenCV. When I found this problem, I regretted too late and had no choice but to install it again

Note: after the compilation of OpenCV fails, there must be some failures and errors in front of it, that is to solve the problem and the core, as shown in the figure above akefile:160 : recipe for target ‘all’ failed “can’t locate the problem. If you look up, you can find the cause of the problem and continue to solve it

Solutions

After searching through a stream, you can find it in the blog (
0 https://stackoverflow.com/questions/40322301/compile-opencv-3-on-ubuntu-16-04-linking-error-usr-lib-x86-64-linux-gnu-libsox )Find the answer in

There are two ways

First method:

add  -D WITH_OPENMP=ON

The second method

Remove the Anaconda path from the system variables
sudo gedit ~/.bashrc

Comment out the following two lines

#export PATH="/home/lab/SOFT_APP/Anaconda2/bin:$PATH"
#export PATH="/home/lab/SOFT_APP/Anaconda2/bin:$PATH"

Effective immediately:

source ~/.bashrc

At this time, you can compile

How to use Anaconda

Some students may ask how to use Anaconda after deleting its environment variable. In fact, it can be used directly in the directory of anaconda

bin/conda info -e
source bin/activate tf_v0.12.0rc0
source bin/deactivate 

Using as a Other:

Additional parameter:

-DENABLE_PRECOMPILED_HEADERS=OFF
-DBUILD_TESTS=OFF

Similar Posts: