Why do I get CMake Error at cmake/OpenCVDetectCXXCompiler.cmake:85?

Hi, I’m new to OpenCV. Trying to install on R Pi 3B. I am following this guide:

When I get to this step:

cmake -D CMAKE_BUILD_TYPE=RELEASE
-D CMAKE_INSTALL_PREFIX=/usr/local
-D INSTALL_PYTHON_EXAMPLES=ON
-D INSTALL_C_EXAMPLES=ON
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules
-D BUILD_EXAMPLES=ON …

I get these error messages:

CMake Error at cmake/OpenCVDetectCXXCompiler.cmake:85 (list):
list GET given empty list
Call Stack (most recent call first):
CMakeLists.txt:109 (include)

CMake Error at cmake/OpenCVDetectCXXCompiler.cmake:86 (list):
list GET given empty list
Call Stack (most recent call first):
CMakeLists.txt:109 (include)

CMake Error at cmake/OpenCVDetectCXXCompiler.cmake:89 (math):
math cannot parse the expression: "*100 + ": syntax error, unexpected
exp_TIMES (1).
Call Stack (most recent call first):
CMakeLists.txt:109 (include)

What is wrong?

The Raspberry Pi is a model 3B

What’s language python3 or c++? And memory size(card)?

C++ at a minimum, but both would be better

I used python merely. with 128gb memory card. I used OpenCV 4.5.1. What do u have?

you are using an outdated tutorial by a third party.

it refers to an “itseez” repository and v2.4 or v3.0.0 of OpenCV.

use the github repository or the latest source release (currently v4.5.1)

this process is described in the official documentation:

https://docs.opencv.org/master/d7/d9f/tutorial_linux_install.html

this error has been fixed long ago.

the error is related to GCC changing the format of one of its output messages. the given cmake file (in OpenCV v2.4/v3.0.0) didn’t anticipate that.

@crackwitz thank you so much! :slight_smile: