Skip to content

Fix compilation with gcc 11.

Felix Weiglhofer requested to merge fweig/cbmroot:merge-request-1 into master

GCC 11 on Ubuntu 22.04 requires these includes to compile.

Otherwise fails with the following error instead:

[ 21%] Building CXX object analysis/PWGC2F/femtoscopy/nicafemto/helpers/CMakeFiles/G__NicaCbmHelper.dir/G__NicaCbmHelper.cxx.o
In file included from /home/weiglhofer/cbm/cbmroot/algo/detectors/tof/TofReadoutConfig.cxx:5:
/home/weiglhofer/cbm/cbmroot/algo/detectors/tof/TofReadoutConfig.h:32:5: error: ‘size_t’ does not name a type
   32 |     size_t GetNumElinks(uint16_t equipmentId);
      |     ^~~~~~
/home/weiglhofer/cbm/cbmroot/algo/detectors/tof/TofReadoutConfig.h:11:1: note: ‘size_t’ is defined in header ‘<cstddef>; did you forget to ‘#include <cstddef>’?
   10 | #include <vector>
  +++ |+#include <cstddef>
   11 | 
In file included from /home/weiglhofer/cbm/cbmroot/algo/detectors/bmon/BmonReadoutConfig.cxx:5:
/home/weiglhofer/cbm/cbmroot/algo/detectors/bmon/BmonReadoutConfig.h:38:5: error: ‘size_t’ does not name a type
   38 |     size_t GetNumElinks(uint16_t equipmentId);
      |     ^~~~~~
/home/weiglhofer/cbm/cbmroot/algo/detectors/bmon/BmonReadoutConfig.h:17:1: note: ‘size_t’ is defined in header ‘<cstddef>; did you forget to ‘#include <cstddef>’?
   16 | #include <vector>
  +++ |+#include <cstddef>
   17 | 
Edited by Felix Weiglhofer

Merge request reports