bazel编译报错:absl/base/policy_checks.h:79:2: error: #error "C++ versions less than C++14 are not supported."
使用bazel编译一个软件时报错,报错的信息为:
absl/base/policy_checks.h:79:2: error: #error "C++ versions less than C++14 are not supported."
整个的编译信息为:
devil@hp:~/lab$ bazel build -c opt //:deepmind_lab.so
INFO: Build option --cxxopt has changed, discarding analysis cache.
WARNING: Download from https://mirror.bazel.build/github.com/glennrp/libpng/archive/v1.6.37.zip failed: class java.io.FileNotFoundException GET returned 404 Not Found
DEBUG: Rule 'com_google_absl' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "cd8a6aed3682cd6a0330e0c11828254877531109d7bddc9398f504b314ec9128"
DEBUG: Repository com_google_absl instantiated at:
/home/devil/lab/WORKSPACE:18:13: in <toplevel>
Repository rule http_archive defined at:
/home/devil/.cache/bazel/_bazel_devil/485f2e56923c3d722a11a1d362ce5e93/external/bazel_tools/tools/build_defs/repo/http.bzl:355:31: in <toplevel>
DEBUG: Rule 'bazel_skylib' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "a9432ad1582da1dd8a2bcbbdaf11d887b38d97c226207b00471eeb2985576797"
DEBUG: Repository bazel_skylib instantiated at:
/home/devil/lab/WORKSPACE:12:13: in <toplevel>
Repository rule http_archive defined at:
/home/devil/.cache/bazel/_bazel_devil/485f2e56923c3d722a11a1d362ce5e93/external/bazel_tools/tools/build_defs/repo/http.bzl:355:31: in <toplevel>
INFO: Analyzed target //:deepmind_lab.so (0 packages loaded, 4197 targets configured).
INFO: Found 1 target...
ERROR: /home/devil/.cache/bazel/_bazel_devil/485f2e56923c3d722a11a1d362ce5e93/external/com_google_absl/absl/types/BUILD.bazel:153:11: Compiling absl/types/bad_optional_access.cc failed: (Exit 1): gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 36 arguments skipped) Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
In file included from external/com_google_absl/absl/base/config.h:86,
from external/com_google_absl/absl/types/bad_optional_access.h:26,
from external/com_google_absl/absl/types/bad_optional_access.cc:15:
external/com_google_absl/absl/base/policy_checks.h:79:2: error: #error "C++ versions less than C++14 are not supported."
79 | #error "C++ versions less than C++14 are not supported."
| ^~~~~
Target //:deepmind_lab.so failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 0.426s, Critical Path: 0.26s
INFO: 17 processes: 17 internal.
FAILED: Build did NOT complete successfully
Google一下,找到相关资料:https://issuehint.com/issue/deepmind/lab/241
解决方案:

虽然Google出了相关的解决方法,但是这个东西到底讲的是怎么具体做还是有些不清楚,后来个人尝试了一下,有了具体的操作:
编辑home下文件.bazelrc (该文件一般都是预先不存在的,编辑后直接保存即可)

填写内容:
build --cxxopt=-std=c++14

再次执行编译,顺利通过:

===============================================
相关资料:
https://blog.csdn.net/CrystalShaw/article/details/120053818
https://issuehint.com/issue/deepmind/lab/241
bazel编译报错:absl/base/policy_checks.h:79:2: error: #error "C++ versions less than C++14 are not supported."的更多相关文章
- Maven-010-maven 编译报错:Failure to ... in ... was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced.
今晚在编译 maven 项目的时候,命令行报错,出现 Failure to ... in ... 类似错误,详细的错误信息如下所示: [INFO] -------------------------- ...
- VC中编译报错:error C2011: 'fd_set' : 'struct' type redefinition
这是头文件包含顺序的问题,原因与解决办法见下面代码的注释. /* 包含下面这两个头文件时,必须把winsock2.h放在前面 否则编译报错,N多的重定义错误:例如 error C2011: 'fd_s ...
- RK3399 Android 7.1 删除repo后编译报错
CPU:RK3399 系统:Android 7.1 瑞芯微使用的是 repo 来进行代码管理,但我们需要用 git 来管理,所以就删除了 repo,但是编译就报错,如下:Server is alrea ...
- CentOS7安装mysql8.0编译报错集合
以下都是我安装mysql8.0遇到的一些报错和解决方法 1.does not appear to contain CMakeLists.txt. 原因:mysql下载的源码包不对 解决方法:下载正确的 ...
- 安装hue时,make apps 编译报错
安装hue时,make apps 编译报错 :"Error: must have python development packages for 2.6 or 2.7. Could not ...
- c语言container_of 编译报错
求指针ptr所在的结构体实例的首地址, #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) #define co ...
- 使用C#模拟Outlook发送邮件,代码编译报错
添加OutLook API using OutLook = Microsoft.Office.Interop.Outlook; 发送邮件方法 public void SendEmail() { Out ...
- cordova编译报错:Execution failed for task ':processDebugResources'
cordova编译报错:Execution failed for task ':processDebugResources' 引发这个错误的最扩祸首就是一个中文命名的文件,不知道什么时候加入的,我写了 ...
- 编译报错dereferencing pointer to incomplete type
关于编译报错“dereferencing pointer to incomplete type... 多是没找到结构体的定义,可以在本地复制其定义试试. 参考: http://my.oschina.n ...
- [Intellij] 编译报错 javacTask
报错信息: Idea 编译报错 javacTask: 源发行版 1.6 需要目标发行版 1.6 解决方案:
随机推荐
- epoll使用与原理
使用要点 边缘模式(ET)与水平模式(LT)区别 下面内容来自linux man page The epoll event distribution interface is able to beha ...
- 如何更改.NET中的默认时区?
除了"在操作系统中修改时区信息,然后重启.NET应用程序,使其生效"之外.如何在不修改操作系统时区的前提下,修改.NET中的默认时区呢? 这是一位 同学兼同事 于5月21日在技术群 ...
- 使用GET方法访问网站
使用GET方法访问网站 服务器接收get参数 server.py import flask app = flask.Flask(__name__) @app.route('/') def index( ...
- WebUI自动化测试中关于图片验证码的解决方法
关于怎么识别图片中的文字,传送门:https://www.cnblogs.com/teangtang/p/16157880.html 实现代码如下: #! /usr/bin/env python # ...
- C#.Net筑基-集合知识全解
01.集合基础知识 .Net 中提供了一系列的管理对象集合的类型,数组.可变列表.字典等.从类型安全上集合分为两类,泛型集合 和 非泛型集合,传统的非泛型集合存储为Object,需要类型转.而泛型集合 ...
- (四)Redis 缓存应用、淘汰机制
1.缓存应用 一个系统中不同层面数据访问速度不一样,以计算机为例,CPU.内存和磁盘这三层的访问速度从几十 ns 到 100ns,再到几 ms,性能的差异很大,如果每次 CPU 处理数据时都要到磁盘读 ...
- 基于 Cloudflare Workers 和 cloudflare-docker-proxy 搭建镜像加速服务
本文主要介绍了如何基于 Cloudflare Workers 和 cloudflare-docker-proxy 搭建 dockerhub.gcr.quay 等镜像加速服务. 最近,受限于各种情况,部 ...
- 基于Mock.js,使用C#生成模拟数据
获取某前端框架, 使用 Mock.js 生成模拟数据, 想要对api进行改造,并且保留原始数据,需要使用C# 重写后端api 的数据 模拟的内容: Random.guid() uuid: '@uuid ...
- Linux运行等级
Linux运行级别 Linux system存在7个运行级别 运行级别0:所有进程终止,机器将有序停止,关机时就处于这个运行级别 运行级别1:单用户模式(root用户进行维护),系统中所有的服务也不会 ...
- Java(screw)生成数据库表结构
数据库支持 MySQL MariaDB TIDB Oracle SqlServer PostgreSQL Cache DB(2016) 文档生成支持 html word markdown 方式一:代码 ...