ethz-asl / voxblox-plusplus

A volumetric object-level semantic mapping framework.
https://arxiv.org/pdf/1903.00268.pdf
BSD 3-Clause "New" or "Revised" License
422 stars 91 forks source link

build error, error: no type named 'shared_timed_mutex' in namespace 'std' #85

Closed mikexyl closed 4 years ago

mikexyl commented 4 years ago

Hi, I'm trying to build voxblox++ in a ubuntu16 container. and I got the following error:

In file included from /workspaces/voxgraph_ws/src/voxblox-plusplus/global_segment_map/src/meshing/label_tsdf_mesh_integrator.cc:1:
In file included from /workspaces/voxgraph_ws/src/voxblox-plusplus/global_segment_map/include/global_segment_map/meshing/label_tsdf_mesh_integrator.h:15:
/workspaces/voxgraph_ws/src/voxblox-plusplus/global_segment_map/include/global_segment_map/meshing/instance_color_map.h:16:8: error: no type named 'shared_timed_mutex' in namespace 'std'
  std::shared_timed_mutex color_map_mutex_;
  ~~~~~^
In file included from /workspaces/voxgraph_ws/src/voxblox-plusplus/global_segment_map/src/meshing/label_tsdf_mesh_integrator.cc:1:
In file included from /workspaces/voxgraph_ws/src/voxblox-plusplus/global_segment_map/include/global_segment_map/meshing/label_tsdf_mesh_integrator.h:16:
/workspaces/voxgraph_ws/src/voxblox-plusplus/global_segment_map/include/global_segment_map/meshing/label_color_map.h:16:8: error: no type named 'shared_timed_mutex' in namespace 'std'
  std::shared_timed_mutex color_map_mutex_;
  ~~~~~^
In file included from /workspaces/voxgraph_ws/src/voxblox-plusplus/global_segment_map/src/meshing/label_tsdf_mesh_integrator.cc:1:
/workspaces/voxgraph_ws/src/voxblox-plusplus/global_segment_map/include/global_segment_map/meshing/label_tsdf_mesh_integrator.h:100:8: error: no type named 'shared_timed_mutex' in namespace 'std'
  std::shared_timed_mutex label_instance_map_mutex_;
  ~~~~~^
/workspaces/voxgraph_ws/src/voxblox-plusplus/global_segment_map/src/meshing/label_tsdf_mesh_integrator.cc:73:59: error: too few arguments to function call, expected 2, have 1
    sdf_layer_const_->getAllUpdatedBlocks(&all_tsdf_blocks);
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                 ^
/workspaces/voxgraph_ws/src/voxblox/voxblox/include/voxblox/core/layer.h:194:3: note: 'getAllUpdatedBlocks' declared here
  void getAllUpdatedBlocks(Update::Status bit, BlockIndexList* blocks) const {
  ^
/workspaces/voxgraph_ws/src/voxblox-plusplus/global_segment_map/src/meshing/label_tsdf_mesh_integrator.cc:74:68: error: too few arguments to function call, expected 2, have 1
    label_layer_mutable_ptr_->getAllUpdatedBlocks(&all_label_blocks);
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                  ^
/workspaces/voxgraph_ws/src/voxblox/voxblox/include/voxblox/core/layer.h:194:3: note: 'getAllUpdatedBlocks' declared here
  void getAllUpdatedBlocks(Update::Status bit, BlockIndexList* blocks) const {
  ^
/workspaces/voxgraph_ws/src/voxblox-plusplus/global_segment_map/src/meshing/label_tsdf_mesh_integrator.cc:142:10: error: no member named 'shared_lock' in namespace 'std'
    std::shared_lock<std::shared_timed_mutex> readerLock(
    ~~~~~^
/workspaces/voxgraph_ws/src/voxblox-plusplus/global_segment_map/src/meshing/label_tsdf_mesh_integrator.cc:142:27: error: no member named 'shared_timed_mutex' in namespace 'std'
    std::shared_lock<std::shared_timed_mutex> readerLock(
                     ~~~~~^
/workspaces/voxgraph_ws/src/voxblox-plusplus/global_segment_map/src/meshing/label_tsdf_mesh_integrator.cc:152:24: error: no member named 'shared_timed_mutex' in namespace 'std'
  std::lock_guard<std::shared_timed_mutex> writerLock(
                  ~~~~~^
/workspaces/voxgraph_ws/src/voxblox-plusplus/global_segment_map/src/meshing/label_tsdf_mesh_integrator.cc:152:44: error: unknown type name 'writerLock'
  std::lock_guard<std::shared_timed_mutex> writerLock(
                                           ^
/workspaces/voxgraph_ws/src/voxblox-plusplus/global_segment_map/src/meshing/label_tsdf_mesh_integrator.cc:178:3: error: cannot initialize object parameter of type 'voxblox::MeshIntegrator<voxblox::TsdfVoxel>' with an expression of type 'voxblox::MeshLabelIntegrator'
  extractBlockMesh(tsdf_block, mesh_block);
  ^~~~~~~~~~~~~~~~
1 error generated.

and similar errors in some other files. this looks like a c++ version issue, but I see c++14 flag is already added in the cmakelists, and I also tried gcc 5.5,7.5 and 8.4, all didn't work, the same error thrown.

Do you have any idea?

mikexyl commented 4 years ago

and I also tried ubuntu18 container, but still same error

mikexyl commented 4 years ago

and also tried c++17 and 1z, same result

mikexyl commented 4 years ago

I figured it out, I just forgot to add -DCMAKE_CXX_STANDARD=14 to catkin config

margaritaG commented 4 years ago

I am glad you could solve the issue yourself.

For anyone else experiencing the same problem: just following the installation steps in the Wiki should have you covered with setting the right C++ standard with catkin.