mardi 28 novembre 2017

Install OpenCV Ubuntu 16.04 c++11

I try to install OpenCV 3.3.0 on Ubuntu 16.04. So I write:

cmake -DCMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D INSTALL_C_EXAMPLES=OFF \
-D ENABLE_CXX11=ON \
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.3.0/modules \
-D PYTHON_EXECUTABLE=~/.virtualenvs/cv/bin/python \
-D BUILD_EXAMPLES=ON ..

But Configuring incomplete, errors occurred! My CMakeError.log:

Compilation failed:
    source file: '/home/natalya/opencv-3.3.0/cmake/checks/cxx11.cpp'
    check option: ''
===== BUILD LOG =====
Change Dir: /home/natalya/opencv-3.3.0/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_038ae/fast"
/usr/bin/make -f CMakeFiles/cmTC_038ae.dir/build.make CMakeFiles/cmTC_038ae.dir/build
make[1]: Entering directory '/home/natalya/opencv-3.3.0/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_038ae.dir/cxx11.cpp.o
/usr/bin/c++      -o CMakeFiles/cmTC_038ae.dir/cxx11.cpp.o -c /home/natalya/opencv-3.3.0/cmake/checks/cxx11.cpp
/home/natalya/opencv-3.3.0/cmake/checks/cxx11.cpp:4:2: error: #error "C++11 is not supported"
 #error "C++11 is not supported"
  ^
/home/natalya/opencv-3.3.0/cmake/checks/cxx11.cpp: In function ‘int main()’:
/home/natalya/opencv-3.3.0/cmake/checks/cxx11.cpp:11:10: error: ‘res’ does not name a type
     auto res = test();
          ^
/home/natalya/opencv-3.3.0/cmake/checks/cxx11.cpp:12:12: error: ‘res’ was not declared in this scope
     return res;
            ^
CMakeFiles/cmTC_038ae.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_038ae.dir/cxx11.cpp.o' failed
make[1]: *** [CMakeFiles/cmTC_038ae.dir/cxx11.cpp.o] Error 1
make[1]: Leaving directory '/home/natalya/opencv-3.3.0/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_038ae/fast' failed
make: *** [cmTC_038ae/fast] Error 2

===== END =====

I read many adviсes, but it isn't helps me.
Help me please.

Aucun commentaire:

Enregistrer un commentaire