Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
197 views
in Technique[技术] by (71.8m points)

Problems trying to build opencv in python: "-- Configuring incomplete, errors occurred"

I'm trying to install openCV in python

I have the same problem as mentioned in those several github and stackoverflow pages but I'm still stuck:

github openCV issue #8382

github openCV issue #6027

github openCV issue #6066

Here is an ouput of the terminal:

mymacs-MacBook-Pro:build mymac$ cmake -D CMAKE_BUILD_TYPE=RELEASE 
>     -D CMAKE_INSTALL_PREFIX=/usr/local 
>     -D INSTALL_C_EXAMPLES=OFF 
>     -D INSTALL_PYTHON_EXAMPLES=ON 
>     -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules 
>     -D BUILD_EXAMPLES=ON ..
CMake Deprecation Warning at CMakeLists.txt:72 (cmake_policy):
  The OLD behavior for policy CMP0022 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


CMake Deprecation Warning at CMakeLists.txt:77 (cmake_policy):
  The OLD behavior for policy CMP0026 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


CMake Deprecation Warning at CMakeLists.txt:82 (cmake_policy):
  The OLD behavior for policy CMP0042 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


-- Could NOT find GDAL (missing: GDAL_LIBRARY GDAL_INCLUDE_DIR) 
-- Checking for module 'gstreamer-base-1.0'
--   No package 'gstreamer-base-1.0' found
-- Checking for module 'gstreamer-video-1.0'
--   No package 'gstreamer-video-1.0' found
-- Checking for module 'gstreamer-app-1.0'
--   No package 'gstreamer-app-1.0' found
-- Checking for module 'gstreamer-riff-1.0'
--   No package 'gstreamer-riff-1.0' found
-- Checking for module 'gstreamer-pbutils-1.0'
--   No package 'gstreamer-pbutils-1.0' found
-- Checking for module 'gstreamer-base-0.10'
--   No package 'gstreamer-base-0.10' found
-- Checking for module 'gstreamer-video-0.10'
--   No package 'gstreamer-video-0.10' found
-- Checking for module 'gstreamer-app-0.10'
--   No package 'gstreamer-app-0.10' found
-- Checking for module 'gstreamer-riff-0.10'
--   No package 'gstreamer-riff-0.10' found
-- Checking for module 'gstreamer-pbutils-0.10'
--   No package 'gstreamer-pbutils-0.10' found
-- Checking for module 'libv4l1'
--   No package 'libv4l1' found
-- Checking for module 'libv4l2'
--   No package 'libv4l2' found
-- Looking for linux/videodev.h
-- Looking for linux/videodev.h - not found
-- Looking for linux/videodev2.h
-- Looking for linux/videodev2.h - not found
-- Looking for sys/videoio.h
-- Looking for sys/videoio.h - not found
-- Checking for module 'libgphoto2'
--   No package 'libgphoto2' found
-- Found PythonInterp: /usr/local/bin/python2.7 (found suitable version "2.7.14", minimum required is "2.7") 
-- Found PythonLibs: /usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/bin (found suitable exact version "2.7.14") 
-- Found PythonInterp: /Users/mymac/.virtualenvs/cv/bin/python (found suitable version "3.5.4", minimum required is "3.4") 
-- Found PythonLibs: /usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/config-3.5m/libpython3.5.dylib (Required is exact version "3.5.4") 
-- Could NOT find Matlab (missing: MATLAB_MEX_SCRIPT MATLAB_INCLUDE_DIRS MATLAB_ROOT_DIR MATLAB_LIBRARIES MATLAB_LIBRARY_DIRS MATLAB_MEXEXT MATLAB_ARCH MATLAB_BIN) 
-- VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file
-- Caffe:   NO
-- Protobuf:   NO
-- Glog:   NO
CMake Error at /Users/mymac/opencv_contrib/modules/datasets/CMakeLists.txt:7 (ocv_append_source_files_cxx_compiler_options):
  Unknown CMake command "ocv_append_source_files_cxx_compiler_options".


-- Configuring incomplete, errors occurred!
See also "/Users/mymac/opencv/build/CMakeFiles/CMakeOutput.log".
See also "/Users/mymac/opencv/build/CMakeFiles/CMakeError.log".
mymacs-MacBook-Pro:build mymac$ 
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

As mentioned on this here I tried checkout the same version for opencv_contrib that I did for opencv by running the following command:

cd ~
cd opencv
git checkout 3.0.0
cd ~
cd opencv_contrib
git checkout 3.0.0

It worked

I then ran the command make -j4

but the two following error messages appeared:

In file included from /Users/mymac/opencv_contrib/modules/cvv/src/gui/main_call_window.cpp:1:
In file included from /Users/mymac/opencv_contrib/modules/cvv/src/gui/main_call_window.hpp:9:
In file included from /Users/mymac/opencv_contrib/modules/cvv/src/gui/overview_panel.hpp:12:/Users/mymac/opencv_contrib/modules/cvv/src/gui/../stfl/stfl_engine.hpp:1056:30: error: use 'template' keyword to treat
  'value' as a dependent template name
            return settings.value(key).value<QStringList>();
                                       ^
                                       template 

In file included from /Users/mymac/opencv_contrib/modules/cvv/src/controller/view_controller.cpp:12:
In file included from /Users/mymac/opencv_contrib/modules/cvv/src/controller/../gui/overview_panel.hpp:12: /Users/mymac/opencv_contrib/modules/cvv/src/controller/../gui/../stfl/stfl_engine.hpp:1056:30: error: use 'template'
  keyword to treat 'value' as a dependent template name
            return settings.value(key).value<QStringList>();
                                       ^
                                       template 

For this i created a new question here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...