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 解决方案:
随机推荐
- OAuth + Security - 2 - 资源服务器配置
PS:此文章为系列文章,建议从第一篇开始阅读. 资源服务器配置 @EnableResourceServer 注解到一个@Configuration配置类上,并且必须使用ResourceServerCo ...
- FreeRTOS简单内核实现5 阻塞延时
0.思考与回答 0.1.思考一 为什么 FreeRTOS简单内核实现3 任务管理 文章中实现的 RTOS 内核不能看起来并行运行呢? Task1 延时 100ms 之后执行 taskYIELD() 切 ...
- 可以把 FolkMQ 内嵌到 SpringBoot3 项目里(可内嵌的消息中间件,纯血国产)
之前发了<把 FolkMQ 内嵌到 SpringBoot2 项目里(比如 "诺依" 啊)>.有人说都淘态了,有什么好内嵌的...所以再发个 SpringBoot3 Fo ...
- redhat6.5 升级 openssl
上传版本包: openssl-1.0.1u.tar.gz 解压缩安装包: tar -xf openssl-1.0.1u.tar.gz 安装版本: ./config --prefix=/usr/loca ...
- 简单测下C++20 vector array lambda 的常数
某天打了一下 CF,遇到了一道 https://codeforces.com/contest/1806/problem/E 这里需要卡常. 于是在 C++20(64) 下测出来了一些神奇的结果. 结果 ...
- 基于LoRA的RLHF
参考Github 开源模型LLM-Tuning 一.简介 (1)RLHF (基于人类反馈的强化学习) 分为三步: SFT (Supervised Fine-Tuning): 有监督的微调,使用正常的 ...
- 用python处理html代码的转义与还原-转
本篇博客来源: 用python处理html代码的转义与还原 'tag>aaa</tag> # 转义还原 str_out = html.unescape(str_out) print( ...
- Java项目静态资源映射的几种方式
一.Springboot 1.webjars方式 我们之前使用Maven构建一个Web项目时,在main目录下会存在一个webapp的目录,我们以前都是将所有的页面或静态资源导在这个目录下,但现在使用 ...
- Docker 总体架构图解
Docker 的总体架构 Docker 是一个 C/S 模式的架构,后端是一个松耦合架构,模块各司其职. 下图是它的总体架构图: 1. 用户使用 Docker Client 与 Docker Daem ...
- Mac mysql 5.7.x 设置服务开机自启动
在终端输入 sudo vi /Library/LaunchDaemons/com.mysql.mysql.plist 输入以下内容 <?xml version="1.0" e ...