OpenCV Linux 安装 Make出错
执行完CMake之后再执行make时遇到以下错误
[ %] Generating precomp.hpp.gch/opencv_core_Release.gch
In file included from /usr/include/c++//bits/stl_algo.h::,
from /usr/include/c++//algorithm:,
from /opt/opencv/opencv-3.1./modules/core/include/opencv2/core/base.hpp:,
from /opt/opencv/opencv-3.1./modules/core/include/opencv2/core.hpp:,
from /opt/opencv/opencv-3.1./modules/core/include/opencv2/core/utility.hpp:,
from /opt/opencv/build/modules/core/precomp.hpp::
/usr/include/c++//cstdlib::: fatal error: stdlib.h: 没有那个文件或目录
#include_next <stdlib.h>
^
compilation terminated.
modules/core/CMakeFiles/pch_Generate_opencv_core.dir/build.make:: recipe for target 'modules/core/precomp.hpp.gch/opencv_core_Release.gch' failed
make[]: *** [modules/core/precomp.hpp.gch/opencv_core_Release.gch] Error
CMakeFiles/Makefile2:: recipe for target 'modules/core/CMakeFiles/pch_Generate_opencv_core.dir/all' failed
make[]: *** [modules/core/CMakeFiles/pch_Generate_opencv_core.dir/all] Error
Makefile:: recipe for target 'all' failed
make: *** [all] Error
这是由于gcc6已经吧stdlib.h纳入了libstdc++以进行更好的优化,C Library的头文件stdlib.h使用 Include_next,而include_next对gcc系统头文件路径很敏感。
推荐的修复方法是不要把include路径作为系统目录,而是使用标准方式包含include 目录
翻译自 https://bugs.webkit.org/show_bug.cgi?id=161697
原文说明:
Trying to build WebKitGTK+ with GCC I got this error: In file included from /home/igalia/clopez/yocto/commit-builds/meta-webkit/builds/qemux86-/tmp-glibc/sysroots/qemux86/usr/include/c++/6.2./ext/string_conversions.h::,
from /home/igalia/clopez/yocto/commit-builds/meta-webkit/builds/qemux86-/tmp-glibc/sysroots/qemux86/usr/include/c++/6.2./bits/basic_string.h:,
from /home/igalia/clopez/yocto/commit-builds/meta-webkit/builds/qemux86-/tmp-glibc/sysroots/qemux86/usr/include/c++/6.2./string:,
from /home/igalia/clopez/yocto/commit-builds/meta-webkit/builds/qemux86-/tmp-glibc/work/i586-oe-linux/webkitgtk/2.12.-r0/webkitgtk-2.12./Source/ThirdParty/ANGLE/src/common/debug.h:,
from /home/igalia/clopez/yocto/commit-builds/meta-webkit/builds/qemux86-/tmp-glibc/work/i586-oe-linux/webkitgtk/2.12.-r0/webkitgtk-2.12./Source/ThirdParty/ANGLE/src/common/mathutil.h:,
from /home/igalia/clopez/yocto/commit-builds/meta-webkit/builds/qemux86-/tmp-glibc/work/i586-oe-linux/webkitgtk/2.12.-r0/webkitgtk-2.12./Source/ThirdParty/ANGLE/src/common/mathutil.cpp::
/home/igalia/clopez/yocto/commit-builds/meta-webkit/builds/qemux86-/tmp-glibc/sysroots/qemux86/usr/include/c++/6.2./cstdlib::: fatal error: stdlib.h: No such file or directory
#include_next <stdlib.h> The issue seems to be that GCC has now introduced stdlib.h in libstdc++ for better compliance and its including the C library stdlib.h using include_next which is sensitive to order of system header include paths. See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70129 The recommended way to fix this is to stop adding include directories as system ones (-isystem) and instead use the standard way to include directories (-I) The openembedded project is carrying this downstream patch against WebKitGTK+ 2.12 with the above fix: http://git.openembedded.org/openembedded-core/tree/meta/recipes-sato/webkit/files/0001-WebKitMacros-Append-to-I-and-not-to-isystem.patch
OpenCV对gcc6支持不完善,导致gcc不兼容OpenCV
解决方法:卸载Ubuntu 16,使用Ubuntu 14
===========================================================
以上解法其实没有必要,gcc6并不是不能编译OpenCV 3,加入以下编译选项即可
-DENABLE_PRECOMPILED_HEADERS=OFF
知识来源:https://www.cnblogs.com/wuchaodzxx/p/8418980.html
感谢提供解法。
OpenCV Linux 安装 Make出错的更多相关文章
- Linux 安装OpenSSL出错的解决方法
以前编译php没有 –with–openssl 现在要使用到 openssl ,phpinze扩展安装,但是在make时候报错 今天找这个在网上找了大半天,最后总结应该是php版本本身的问题,错误是p ...
- linux安装命令出错(could not resolve host mirrorlist.centos.org)
本次问题出现在虚拟机安装的centos7系统之后,使用yum命令安装wget命令(yum -y install wget),出现could not resolve host mirrorlist.ce ...
- OPENCV Linux安装
https://docs.opencv.org/master/d7/d9f/tutorial_linux_install.html
- linux安装curl出错
今天配置一台server的php支持curl的时候, 出现如下报错 checking for cURL in default path... not foundconfigure: error: Pl ...
- Linux安装软件出错
1.Delta RPMs disabled because /usr/bin/applydeltarpm not installed. yum provides '*/applydeltarpm' # ...
- Anaconda+linux +opencv+dlib安装
准备文件Anaconda: https://www.anaconda.com/download/ 我下载的时最新的 64-Bit (x86) Installer (524 MB) 然后在下载的anac ...
- linux安装及配置c++的opencv库
linux安装及配置c++的opencv库 前言: 最近想搞个机器视觉的比赛,要求是linux+opencv环境,没有做过opencv开发的我配置环境就配了两天,看来很多乱七八糟的博客,终于装好了.网 ...
- linux 安装了Linux generic mysql 出错
在一次安装 Linux generic cmake 出错 提示:CMake Error: The source directory "/usr/local/src" does no ...
- 阿里云Linux安装软件镜像源
阿里云Linux安装软件镜像源 阿里云是最近新出的一个镜像源.得益与阿里云的高速发展,这么大的需求,肯定会推出自己的镜像源.阿里云Linux安装镜像源地址:http://mirrors.aliyun. ...
随机推荐
- UVA315 (无向图求割点)
题目大意:给定一个无向图,问共存在多少个割点.(割点:去掉此点后此图会断开连接)割点有两种存在:一种是第一次搜索的根节点,若其子节点数超过两个,则此点去掉后图会 断开连接,因此此点为割点:或者此点为搜 ...
- Angularjs学习---angularjs环境搭建,ubuntu 12.04下安装nodejs、npm和karma
1.下载angularjs 进入其官网下载:https://angularjs.org/,建议下载最新版的:https://ajax.googleapis.com/ajax/libs/angular ...
- andorid Activity和Service音乐播放器
AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xm ...
- libev 宏展开
想看源码,宏太多,看着累,宏展开,再看,功力时间不够,先放下 放上宏展开后的代码. libev4.20 展开方示为 ./configure 修改makefile文件,字符串 替换CC为 CPP 注意要 ...
- HDU 2689Sort it 树状数组 逆序对
Sort it Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Sub ...
- 让图片在div 中居中的方法
方法一: 思路:利用text-align属性将图片水平居中,然后设置padding-top的值使其垂直居中. 结构如下: <div> <img src="images/tt ...
- JS的循环、复杂运算符
一.循环语句 特点:可以重复完成同样的事情 1.while(条件语句/boolean){ 重复执行的代码块 } while的两种写法 var a= prompt("请输入第 ...
- Android学习--摘录
今天准备开始毕业设计--做一个android应用.无奈android基础木有一点,以前做过一个蓝牙应用,不过对android各方面的知识还是不懂啊,今天在android主页上看英文的android开发 ...
- php中英文截取无乱码 包括全角下的字符
符合UTF-8下,如果GBK下 改为 $content .= $str[$sing].$str[$sing+1]; $sing += 3; 改为 $sing += 2; /** ...
- 推荐一个C语言学习教程
Linux C编程一站式学习 http://learn.akae.cn/media/index.html