【问题标题】:make: **all error 2 during opencv installation in ubuntu16.10make: **在 ubuntu16.10 中安装 opencv 时出现所有错误 2
【发布时间】:2017-09-27 22:01:17
【问题描述】:
    [  8%] Generating test_precomp.hpp.gch/opencv_test_imgcodecs_Release.gch
    In file included from /usr/include/c++/6/ext/string_conversions.h:41:0,
             from /usr/include/c++/6/bits/basic_string.h:5402,
             from /usr/include/c++/6/string:52,
             from /home/vibha/OpenCV/modules/viz/include/opencv2/viz/types.hpp:49,
             from /home/vibha/OpenCV/modules/viz/include/opencv2/viz/vizcore.hpp:49,
             from /home/vibha/OpenCV/build/modules/viz/test_precomp.hpp:58:
/usr/include/c++/6/cstdlib:75:25: fatal error: stdlib.h: No such file or directory
#include_next <stdlib.h>
                     ^
compilation terminated.
modules/viz/CMakeFiles/pch_Generate_opencv_test_viz.dir/build.make:62: recipe for target 'modules/viz/test_precomp.hpp.gch/opencv_test_viz_Release.gch' failed
make[2]: *** [modules/viz/test_precomp.hpp.gch/opencv_test_viz_Release.gch] Error 1
CMakeFiles/Makefile2:3080: recipe for target 'modules/viz/CMakeFiles/pch_Generate_opencv_test_viz.dir/all' failed
make[1]: *** [modules/viz/CMakeFiles/pch_Generate_opencv_test_viz.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
In file included from /usr/include/c++/6/ext/string_conversions.h:41:0,
             from /usr/include/c++/6/bits/basic_string.h:5402,
             from /usr/include/c++/6/string:52,
             from /usr/include/c++/6/stdexcept:39,
             from /usr/include/c++/6/array:39,
             from /usr/include/c++/6/tuple:39,
             from /usr/include/c++/6/bits/stl_map.h:63,
             from /usr/include/c++/6/map:61,
             from /home/vibha/OpenCV/build/modules/viz/precomp.hpp:49:
/usr/include/c++/6/cstdlib:75:25: fatal error: stdlib.h: No such file or directory
#include_next <stdlib.h>
                     ^
compilation terminated.
modules/viz/CMakeFiles/pch_Generate_opencv_viz.dir/build.make:62: recipe for target 'modules/viz/precomp.hpp.gch/opencv_viz_Release.gch' failed
make[2]: *** [modules/viz/precomp.hpp.gch/opencv_viz_Release.gch] Error 1
CMakeFiles/Makefile2:3186: recipe for target 'modules/viz/CMakeFiles/pch_Generate_opencv_viz.dir/all' failed
make[1]: *** [modules/viz/CMakeFiles/pch_Generate_opencv_viz.dir/all] Error 2
[  9%] Generating perf_precomp.hpp.gch/opencv_perf_imgcodecs_Release.gch
[  9%] Built target pch_Generate_opencv_perf_imgcodecs
[  9%] Built target pch_Generate_opencv_test_imgcodecs
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2

我已经安装了 build-essential 软件包。 还发现 stdlib.h 存在。 但我仍然收到此错误。

我在 ubuntu 16.10 上从 https://github.com/milq/milq/blob/master/scripts/bash/install-opencv.sh 安装 opencv 3.2

我是 linux 新手,所以如果我做错了什么,请告诉我。(我已按照上述站点中的所有说明进行操作..)

【问题讨论】:

标签: opencv cmake


【解决方案1】:

“您可能错过了 OpenCV 3.2.0 的先决条件”

[compiler] sudo apt-get install build-essential
[required] sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
[optional] sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev

参考:

Tutorial OpenCV Linux

linuxfromscratch opencv

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-02-24
    • 2012-07-28
    • 2018-05-18
    • 2017-03-16
    • 2022-11-15
    相关资源
    最近更新 更多