(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博客
感谢!