• 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博客

    感谢!

  • 相关阅读:
    OpenCV图像特征提取学习三,LBP图像特征检测算法
    STM32F303RE 四个ADC同步规则采样
    项目管理软件dhtmlxGantt配置教程(十七):实现RTL(从右到左)模式
    JVM类加载机制详解
    速报|StarRocks亮相云栖大会,携手阿里云EMR 打造极速数据湖分析新体验
    C# 通过子窗体刷新父窗体:窗体控制
    Java与Redis的集成
    JdbcTemplate
    【JAVA】==和equal的区别
    安装mosek,license安装位置查找
  • 原文地址:https://blog.csdn.net/qq_40297851/article/details/127805042