Search code examples
opencvubunturaspberry-piraspbianqpython3

Makefile:160: recipe for target 'all' failed


Guys am trying to install OpenCV 3.3.1 on Raspbian stretch Noobs on Pi model B I am following this tutorial.

But when i type

cmake
-D CMAKE_BUILD_TYPE=RELEASE \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_C_EXAMPLES=OFF \
-D OPENCV_EXTRA_MODULES_PATH= ~/Opencv_contrib-3.3.1/modules \
-D BUILD_opencv_python3=yes \
-D BUILD_EXAMPLES=ON \
-D WITH_CUDA=OFF.. `

And then i type make -j2

To get this error

[  7%] building cxx object 3rsparty/openexr/CMakeFiles/IlmImf.dir/IlmImf/    ImfZipcompressor.cpp.o
[  7%] linking cxx static library.. /lib/libIlmImf.a
[  7%] built target IlmImf
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2

What's the problem?


Solution

  • I found that the problem was in this line

    /home/pi/opencv3.3.1/3rdparty/carotene/src/absdiff.cpp:42:22: fatal error: common.hpp: no such file or directory
     #include "common.hpp"
    

    I 've gone through the directory and opened absdiff.cpp to find #include "common.hpp" But no file called common.hpp in the same directory so i copied common.hpp from /home/pi/opencv/3rd party/carotene/src/ Which i cloned using this code git clone https://github.com/Itseez/opencv.git opencv

    I don't know why opencv-3.3.1 doesn't have it or just an issue during the download...

    Or just re-download opencv-3.3.1 again