Ask Your Question
1

Problem with building opencv_contrib

asked 2018-05-22 12:53:06 -0600

MarviB gravatar image
System information (version)
  • OpenCV => 3.4.1
  • Operating System / Platform => macOS High Sierra
  • Compiler => Apple Clang 9.1.0.9020039
Detailed description

I get these two errors while building OpenCV_contrib:

/Users/Marvin/Documents/OpenCV3/opencv_contrib/modules/face/src/lbph_faces.cpp:312:1: error: control may reach end of non-void function [-Werror,-Wreturn-type]

/Users/Marvin/Documents/OpenCV3/opencv_contrib/modules/bioinspired/src/retina_ocl.cpp:395:1: error: control may reach end of non-void function [-Werror,-Wreturn-type] } ^ /Users/Marvin/Documents/OpenCV3/opencv_contrib/modules/bioinspired/src/retina_ocl.cpp:451:65: error: control reaches end of non-void function [-Werror,-Wreturn-type] const Mat RetinaOCLImpl::getMagnoRAW() const { NOT_IMPLEMENTED; } ^ /Users/Marvin/Documents/OpenCV3/opencv_contrib/modules/bioinspired/src/retina_ocl.cpp:452:65: error: control reaches end of non-void function [-Werror,-Wreturn-type] const Mat RetinaOCLImpl::getParvoRAW() const { NOT_IMPLEMENTED; }

What am i doing wrong?

This is the cmake command:

cmake -D CMAKE_BUILD_TYPE=RELEASE -D PYTHON2_LIBRARY=$PYTHON2_LIBRARY -D PYTHON2_INCLUDE_DIR=$PYTHON2_INCLUDE_DIR -D PYTHON2_EXECUTABLE=$PYTHON2_EXECUTABLE -D BUILD_opencv_python2=ON -D BUILD_opencv_python3=OFF -D INSTALL_PYTHON_EXAMPLES=ON -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules/ ../opencv

I want to build OpenCV with the Contrib module with Python support, it worked previously without the opencv_contrib model.

Thanks for your help, Marvin

edit retag flag offensive close merge delete

Comments

just curious, the buildbots do not set the -Wreturn-type flag. did you add that manually ?

berak gravatar imageberak ( 2018-05-24 01:02:28 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2018-05-22 13:01:24 -0600

berak gravatar image

updated 2018-05-22 13:17:21 -0600

none of it is your fault, you've found some (minor) bugs.

your clang9.0 is somewhat more strict, than the compilers used on the buildbots, imho, it's worth, making an issue here

you could fix it by either disabling the face module:

cmake -DBUILD_opencv_face=OFF

or repairing it, by adding a line like:

return Mat();

in all 3 cases.

edit flag offensive delete link more

Comments

Found two more:

opencv_contrib/modules/bioinspired/src/retina_ocl.cpp:395:1: error: control may reach end of non-void function [-Werror,-Wreturn-type] }

opencv_contrib/modules/rgbd/src/linemod.cpp:70:1: error: control may reach end of non-void function [-Werror,-Wreturn-type]

"repaired" it by adding return false in the last else statement and return 8 after the switch statement.

MarviB gravatar imageMarviB ( 2018-05-22 13:33:29 -0600 )edit

good !

please do make an issue there, and maybe even be as bold to contribute a solution !

(it's a fairly low hanging fruit, no ?)

berak gravatar imageberak ( 2018-05-22 13:37:15 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-05-22 12:53:06 -0600

Seen: 333 times

Last updated: May 22 '18