Failed to create opencv 2.4.10 on mac 10.10.3

I tried to create opencv 2.4.10 on Mac 10.10.3 with Xcode 6.3. The following errors occurred while creating.

/Users/Shirui/work/program/opencv-2.4.10/modules/legacy/src/calibfilter.cpp:98:9: error: array comparison 'this-> latestPoints' not equal to a null pointer is always true [-Werror , -Wtautological-pointer-compare] if (latestPoints! = NULL) ^ ~~~~~~~~~~~ ~~~~ / Users / Shirui / work / program / opencv -2.4.10 / modules / legacy / src / calibfilter.cpp: 526: 9: error: array address 'this-> latestCounts' will always evaluate to 'true' [-Werror, -Wpointer-bool-conversion] if (latestCounts) ~~ ^ ~~~~~ ~~~~~~ Created 2 errors.

Commands I used:

mkdir path-to-opencv-source/build cd path-to-opencv-source/build cmake -G "Unix Makefiles" .. make -j8 

thanks a lot

+2
source share
2 answers

This is actually a problem when creating OpencV with clang .

First discussed and fixed here .

You can fix yourself or just download a newer version of OpenCV.

+5
source

I was told that you can turn off the warning globally by adding -Wno-tautological-pointer-compare with your compiler flags or on a one-time basis by wrapping the variable that you are testing in parentheses.

+1
source

All Articles