Ubuntu installation opencv and problem solving (common to all versions)
Install and compile
Get the source code
git clone https://github.com/opencv/opencv
cd opencv
Switch to the version branch you want. I am using 2.4.13.3 here. Which version do you want to install?
git checkout 2.4.13.3
-j8
It is to choose eight-core compilation. If the computer is quad-core make -j4
, it will be direct if you are not sure make
. The impact is not big, but the change of compilation speed
mkdir -p build && cd build
cmake -DWITH_VTK=ON -DBUILD_opencv_calib3d=ON -DBUILD_opencv_imgproc=ON -DWITH_CUDA=OFF ..
make -j8
sudo make install
cd ../../
error and solution
one
CMake Error at cmake/OpenCVDetectCXXCompiler.cmake:81 (list):
list GET given empty list
Call Stack (most recent call first):
CMakeLists.txt:96 (include)
open error fileopencv/cmake/OpenCVDetectCXXCompiler.cmake
Ctrl+F
Open the search box to search dumpversion
, replace it withdumpfullversion
two
– Detected version of GNU GCC: (ERROR)
CMake Error at cmake/OpenCVCompilerOptions.cmake:21 (else):
Flow control statements are not properly nested.
Call Stack (most recent call first):
CMakeLists.txt:437 (include)
on For the wrong file cmake/OpenCVCompilerOptions.cmake
, just comment out lines 21 and 22