使用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."的更多相关文章

  1. 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] -------------------------- ...

  2. VC中编译报错:error C2011: 'fd_set' : 'struct' type redefinition

    这是头文件包含顺序的问题,原因与解决办法见下面代码的注释. /* 包含下面这两个头文件时,必须把winsock2.h放在前面 否则编译报错,N多的重定义错误:例如 error C2011: 'fd_s ...

  3. RK3399 Android 7.1 删除repo后编译报错

    CPU:RK3399 系统:Android 7.1 瑞芯微使用的是 repo 来进行代码管理,但我们需要用 git 来管理,所以就删除了 repo,但是编译就报错,如下:Server is alrea ...

  4. CentOS7安装mysql8.0编译报错集合

    以下都是我安装mysql8.0遇到的一些报错和解决方法 1.does not appear to contain CMakeLists.txt. 原因:mysql下载的源码包不对 解决方法:下载正确的 ...

  5. 安装hue时,make apps 编译报错

    安装hue时,make apps 编译报错 :"Error: must have python development packages for 2.6 or 2.7. Could not ...

  6. c语言container_of 编译报错

    求指针ptr所在的结构体实例的首地址, #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) #define co ...

  7. 使用C#模拟Outlook发送邮件,代码编译报错

    添加OutLook API using OutLook = Microsoft.Office.Interop.Outlook; 发送邮件方法 public void SendEmail() { Out ...

  8. cordova编译报错:Execution failed for task ':processDebugResources'

    cordova编译报错:Execution failed for task ':processDebugResources' 引发这个错误的最扩祸首就是一个中文命名的文件,不知道什么时候加入的,我写了 ...

  9. 编译报错dereferencing pointer to incomplete type

    关于编译报错“dereferencing pointer to incomplete type... 多是没找到结构体的定义,可以在本地复制其定义试试. 参考: http://my.oschina.n ...

  10. [Intellij] 编译报错 javacTask

    报错信息: Idea 编译报错 javacTask: 源发行版 1.6 需要目标发行版 1.6 解决方案:

随机推荐

  1. JVM垃圾回收器与调优参数

    引言 JVM为了更有效率的对堆空间进行垃圾回收,把堆空间进行了分代,分为年轻代.老年代和永久代(在1.8版本以后,永久代已经被彻底移除了,被元空间取而代之). 当一个对象出生时,会首先选择在eden区 ...

  2. 工程数学 实验5-MATLAB最优化工具箱的使用

    (1)线性规划应用案例的求解 1.基本要求 通过一个农业生产计划优化安排的实例求解,培养学生解决实际线性规划问题的初步能力:熟悉线性规划的建模过程:掌握Matlab优化工具箱中线性规划函数的调用. 2 ...

  3. RSA密码系统的特定密钥泄露攻击与Coppersmith方法的应用

    PrimiHub一款由密码学专家团队打造的开源隐私计算平台,专注于分享数据安全.密码学.联邦学习.同态加密等隐私计算领域的技术和内容. RSA密码系统作为当前最广泛使用的公钥加密算法之一,其安全性依赖 ...

  4. Xilinx-HDF的文件内容

    Xilinx-HDF文件 原文:分享:HDF文件的更多用途 Xilnx Vivado能导出HDF文件,给Xilnx SDK创建软件工程.HDF文件的还可以有更多用途. HDF文件是一个zip文件,可以 ...

  5. 合并STM32 iap的hex文件合并为一个hex文件

    --- title: 合并STM32 iap的hex文件合并为一个hex文件 date: 2020-06-15 04:32:26 categories: tags: - iap - stm32 --- ...

  6. python基础-json

    import json # 准备列表,列表内每一个元素都是字典,将其转为JSON date = [{"name": "张大帅", "age" ...

  7. [FLET] 01 可以拖动的方块

    from typing import List import flet from flet import ( Container, Draggable, DragTarget, Page, Row, ...

  8. SpringBoot整合模版引擎freemarker实战

    Freemarker相关maven依赖 <dependency> <groupId>org.springframework.boot</groupId> <a ...

  9. 解决php提示Maximum execution time of 30 seconds exceeded错误

    如何解决错误? 基本上,有3种方法可以处理此错误: 修改php配置文件php.ini文件 使用 ini_set() 函数 使用set_time_limit()函数 1)修改php配置文件php.ini ...

  10. django 如何查询汇总的求和时避免没有数据导致的错误

    django 如何查询汇总的求和时避免没有数据导致的错误 在 Django 中,如果你希望对某个字段进行求和操作,并在没有数据时返回默认值,可以使用 aggregate 结合 Coalesce 函数. ...