在ubuntu下配置opencv,cmake成功了,而make时候报错 3C

1 [ 6%] Generating precomp.hpp.gch/opencv_core_Release.gch
2 In file included from /usr/include/c++/6/bits/stl_algo.h:59:0,
3 from /usr/include/c++/6/algorithm:62,
4 from /opt/opencv/opencv-3.1.0/modules/core/include/opencv2/core/base.hpp:53,
5 from /opt/opencv/opencv-3.1.0/modules/core/include/opencv2/core.hpp:54,
6 from /opt/opencv/opencv-3.1.0/modules/core/include/opencv2/core/utility.hpp:52,
7 from /opt/opencv/build/modules/core/precomp.hpp:49:
8 /usr/include/c++/6/cstdlib:75:25: fatal error: stdlib.h: 没有那个文件或目录
9 #include_next
10 ^
11 compilation terminated.
12 modules/core/CMakeFiles/pch_Generate_opencv_core.dir/build.make:62: recipe for target 'modules/core/precomp.hpp.gch/opencv_core_Release.gch' failed
13 make[2]: *** [modules/core/precomp.hpp.gch/opencv_core_Release.gch] Error 1
14 CMakeFiles/Makefile2:1178: recipe for target 'modules/core/CMakeFiles/pch_Generate_opencv_core.dir/all' failed
15 make[1]: *** [modules/core/CMakeFiles/pch_Generate_opencv_core.dir/all] Error 2
16 Makefile:160: recipe for target 'all' failed
17 make: *** [all] Error 2
图片说明

3个回答

http://blog.csdn.net/yygydjkthh/article/details/41787049

/usr/include/c++/6/cstdlib:75:25: fatal error: stdlib.h: 没有那个文件或目录

obviousYDC
obviousYDC 这个链接里面说的东西我都不缺呀
2 年多之前 回复

应该是cmake的时候的依赖项没有安装全,当时提示没有找到的不一定会报错,可以看一下cmake的打印信息

这是Gcc6的一个改动造成的,

解决方法:
Try by disabling pre-compiled headers, either from cmake-gui or using the command line parameter

-DENABLE_PRECOMPILED_HEADERS=OFF
参考这里:

https://stackoverflow.com/questions/40262928/error-compiling-opencv-fatal-error-stdlib-h-no-such-file-or-directory

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!