• will be initialized after [-Werror=reorder]


    (base) studieren@studieren-GS65-Stealth-Thin-8RE:~/apollo$ sudo ./docker/scripts/dev_into.sh
    root@in-dev-docker:/apollo# bazel build modules/drivers/basler/binary_exposure_search
    Starting local Bazel server and connecting to it...
    (05:48:16) INFO: Current date is 2022-11-11
    (05:48:18) INFO: Analyzed target //modules/drivers/basler:binary_exposure_search (53 packages loaded, 1198 targets configured).
    (05:48:18) INFO: Found 1 target...
    (05:48:20) ERROR: /apollo/modules/drivers/basler/BUILD:122:11: C++ compilation of rule '//modules/drivers/basler:binary_exposure_search' failed (Exit 1)
    In file included from modules/drivers/basler/binary_exposure_search.cpp:32:0:
    ./modules/drivers/basler/binary_exposure_search.h: In constructor 'apollo::drivers::basler::pylon_camera::BinaryExposureSearch::BinaryExposureSearch(const float&, const float&, const float&, const float&)':
    ./modules/drivers/basler/binary_exposure_search.h:116:11: error: 'apollo::drivers::basler::pylon_camera::BinaryExposureSearch::new_exposure_' will be initialized after [-Werror=reorder]
         float new_exposure_;
               ^~~~~~~~~~~~~
    ./modules/drivers/basler/binary_exposure_search.h:91:17: error:   'const float apollo::drivers::basler::pylon_camera::BinaryExposureSearch::target_brightness_' [-Werror=reorder]
         const float target_brightness_;
                     ^~~~~~~~~~~~~~~~~~
    modules/drivers/basler/binary_exposure_search.cpp:40:1: error:   when initialized here [-Werror=reorder]
     BinaryExposureSearch::BinaryExposureSearch(const float& target_brightness,
     ^~~~~~~~~~~~~~~~~~~~
    cc1plus: some warnings being treated as errors
    Target //modules/drivers/basler:binary_exposure_search failed to build
    Use --verbose_failures to see the command lines of failed build steps.
    (05:48:20) INFO: Elapsed time: 5.607s, Critical Path: 2.24s
    (05:48:20) INFO: 0 processes.
    (05:48:20) FAILED: Build did NOT complete successfully

    这个错误太搞笑了。

    声明顺序和初始化顺序要保持一致!

    声明:

    初始化:

    参考了will be initialized after [-Wreorder], 类成员构造顺序-ckelsel-ChinaUnix博客

    感谢!

  • 相关阅读:
    嵌入式系统开发笔记106:发光二极管间隔闪烁
    Linux网络编程:详解https协议
    Cadence Allegro PCB设计88问解析(二十) 之 Allegro中格点设置(一)
    Vue事件处理器:事件绑定基础、事件修饰符:stop、prevent、capture、self、once;
    Vue2.7 封装 Router@4 的 hook
    带外攻击
    golang 锁bug 记录
    【面经】被虐了之后,我翻烂了equals源码,总结如下
    C# 实现websocket双向通信
    选择需求管理工具
  • 原文地址:https://blog.csdn.net/qq_40297851/article/details/127805042