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. ...
随机推荐
- [转]Excel 取汉字拼音首位
转自:http://jingyan.baidu.com/article/63acb44adca44461fcc17e85.html 转自:http://jingyan.baidu.com/articl ...
- andorid service 本地服务
ActivityManifect.xml <?xml version="1.0" encoding="utf-8"?> <manifest x ...
- setAttribute()和getAttibute(),getParameter()
request.setAttribute("key",value)方法给主键设置一个值, request.getAttribute("key")方法从上述设置的 ...
- 通过indexPath找到对应的cell
在- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 这个方法中通过 ...
- Infobright存储引擎的特点
Infobright的优点: (1)高压缩比率 (2)快速响应复杂的分析查询语句 (3)随着数据库的逐渐增大,查询和装载性能基本保持稳定 (4)没有特殊的数据仓库模型(比如星状模型.雪花模型)要求 ( ...
- css省略号
效果图如下: 效果图如下:
- JQuery UI Autocomplete与jquery.autocomplete.js
程序中要把一个select改成可以下拉搜索的,就想到了使用下autocomplete.js大概是这么个东西. 问了下同学,推荐我使用Jquery Ui autocomplete,下载下来开始调试使用, ...
- __slots__ 属性绑定
s = Student() # 创建新的实例 s.name = 'Michael' # 绑定属性'name' s.age = 25 # 绑定属性'age' s.score = 99 # 绑定属性'sc ...
- FreeBSD_11-系统管理——{Part_1-桌面}
一.Xorg 安装 xorg pkg install xorg 清除旧文件(如果已前安装过 xorg) /etc/X11/xorg.conf /usr/local/etc/X11/xorg.conf ...
- python语法快速入门(1)
http://www.runoob.com/python/python-tutorial.html Python 是一种解释型语言: 这意味着开发过程中没有了编译这个环节.类似于PHP和Perl语言 ...