使用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. linux nginx命令 查找目录和重启

    #查看nginx进程 [root@LinuxServer]$ps -aux | grep nginx root 3229 0.0 0.0 112812 972 pts/0 S+ 16:50 0:00 ...

  2. WPF 自定义泛型用户控件后跨程序集继承用户控件的解决方案

    自定义泛型用户控件: <UserControl x:Class="ClassLibrary1.UcEumCmb" xmlns="http://schemas.mic ...

  3. CentOS8 安装ansible

    # 安装epel扩展源 yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm -y # ...

  4. Linux 获取 指定目录 下的 最大子目录深度

    命令 function getDirMaxDepth() { folder_name="$1" if [ ! -d "$folder_name" ];then ...

  5. 【价格全面下调】一片含税79元,双核A7@1.2GHz,-40℃~85℃真工业级!

    自9个月前,创龙科技全志T113-i核心板(SOM-TLT113)推出之后,受到广大工业用户的高度关注,且超过300家企业已选用创龙科技T113-i核心板用于终端产品开发. 为了让更多用户轻松选择T1 ...

  6. SSM配置文件分类及总结

    配置组件通常涉及以下几个方面 数据访问配置 配置数据源.JdbcTemplate.事务管理器等,以支持数据库操作. 服务层与DAO层配置 定义服务类和服务实现类.数据访问对象(DAO)的bean,以及 ...

  7. Linux启动Java程序jar包Shell脚本

    手动方式启动和终止java程序 启动java程序jar:nohup java -jar XXX.jar 查看程序占用pid:ps -ef | grep XXX.jar 或 jps jps是jdk提供的 ...

  8. 怎样理解 Vue 的单向数据流?

    数据从父级组件传递给子组件,只能单向绑定. 子组件内部不能直接修改从父级传递过来的数据. 所有的 prop 都使得其父子 prop 之间形成了一个单向下行绑定:父级 prop 的更新会向下流动到子组件 ...

  9. Java-MVC开发模式

    MVC开发模式 1. jsp演变历史 1. 早期只有Servlet,只能使用response输出标签数据,非常麻烦 2. 后来又jsp,简化了Servlet的开发,如果过度使用jsp,在jsp中即写大 ...

  10. 【Azure Developer】一个复制Redis Key到另一个Redis服务的工具(redis_copy_net8)

    介绍一个简单的工具,用于将Redis数据从一个redis端点复制到另一个redis端点,基于原始存储库转换为.NET 8:https://github.com/LuBu0505/redis-copy- ...