Iman
Iman

Reputation: 424

OpenCV error file INSTALL cannot find /bin/opencv_annotation

I have a problem on compiling OpenCV 3.X.X on Debian but It is OK on Ubuntu. I compile OpenCV with these commands:

cmake -D CMAKE_BUILD_TYPE=RELEASE \
    -D CMAKE_INSTALL_PREFIX=/opt/opencv-3.3.0/build \
    -D OPENCV_EXTRA_MODULES_PATH=/opt/opencv_contrib-3.3.0/modules \
    -D BUILD_SHARED_LIBS=ON \
    -D WITH_FFMPEG=ON \
    -D PYTHON_EXECUTABLE=/opt/virtualenvs/cv/bin/python \
    -D BUILD_EXAMPLES=ON \
    -D WITH_QT=ON \
    -D WITH_OPENGL=ON \
    -D WITH_TBB=OFF \
    -D WITH_OPENMP=ON \
    -D BUILD_opencv_apps=ON \
    -D BUILD_DOCS=ON ..

make -j12

sudo make install - j12

After "make install" I get this error and all shared library in build/lib that were built successfully before error, are deleted!

CMake Error at apps/annotation/cmake_install.cmake:42 (file):
  file INSTALL cannot find "/opt/opencv-3.3.0/build/bin/opencv_annotation".
Call Stack (most recent call first):
  apps/cmake_install.cmake:39 (include)
  cmake_install.cmake:88 (include)


Makefile:66: recipe for target 'install' failed
make: *** [install] Error 1

If I set -D BUILD_opencv_apps=OFF, there is no error in compiling but again at the end all *.so files in build/lib are deleted.

Once in another computer I manage to compile OpenCV successfully but I don't know what exactly I had done.

My system has:

OpenCV 3.3.0
Debian GNU/Linux 8.9 (jessie) 3.16.43-2+deb8u5 (2017-09-19) x86_64 GNU/Linux
cmake version 3.0.2
gcc (Debian 4.9.2-10) 4.9.2

What's the problem?

Upvotes: 0

Views: 1900

Answers (1)

Iman
Iman

Reputation: 424

I found the solution. This error happens when build directory is the same with install directory, At least on some Linux distributions!

I should change install directory.

Upvotes: 3

Related Questions