ethz-asl / voxgraph

Voxblox-based Pose graph optimization
BSD 2-Clause "Simplified" License
522 stars 69 forks source link

Build error with gcc 7.5 on Ubuntu 18.04 #50

Closed alessandromorra closed 3 years ago

alessandromorra commented 3 years ago

When building the package I get the following error:

Starting  >>> voxgraph                                                                                  
________________________________________________________________________________________________________
Errors     << voxgraph:make /home/alessandromorra/arc_ws/logs/voxgraph/build.make.012.log               
/home/alessandromorra/arc_ws/src/voxgraph/voxgraph/src/frontend/submap_collection/voxgraph_submap.cpp: In member function ‘const voxgraph::WeightedSampler<voxgraph::RegistrationPoint>& voxgraph::VoxgraphSubmap::getRegistrationPoints(voxgraph::VoxgraphSubmap::RegistrationPointType) const’:
/home/alessandromorra/arc_ws/src/voxgraph/voxgraph/src/frontend/submap_collection/voxgraph_submap.cpp:141:1: error: control reaches end of non-void function [-Werror=return-type]
  141 | }
      | ^
cc1plus: all warnings being treated as errors
make[2]: *** [CMakeFiles/voxgraph.dir/src/frontend/submap_collection/voxgraph_submap.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/voxgraph.dir/all] Error 2
make: *** [all] Error 2
cd /home/alessandromorra/arc_ws/build/voxgraph; catkin build --get-env voxgraph | catkin env -si  /usr/bin/make --jobserver-fds=6,7 -j; cd -
........................................................................................................
Failed     << voxgraph:make                       [ Exited with code 2 ]                                
Failed    <<< voxgraph                            [ 23.8 seconds ]   

I found a quick fix not sure though if this is desirable: https://github.com/alessandromorra/voxgraph/commit/750593bfb44ad782d9564456b27e94bc80064d38

My setup:

$ gcc --version 
gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
victorreijgwart commented 3 years ago

Hi @alessandromorra, thank you for pointing this out. It turns out we had a few issues in GCC 8 and 9 as well. These are fixed in our newest dev branch, but it'd be good to also fix master. I'll open a PR that fixes this.