Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build with gcc9 #50

Merged
merged 1 commit into from
Nov 27, 2019
Merged

Conversation

jessisar
Copy link

craymichael fixed this over 1 year ago and proposed it to the now dead original upstream. Please take this patch to fix the build on modern compilers.
raulmur/ORB_SLAM2#585

Build error:

Errors     << orb_slam2_ros:make /home/jessi/catkin_ws/logs/orb_slam2_ros/build.make.001.log 
In file included from /usr/include/c++/9.2.0/map:61,
                 from /home/jessi/catkin_ws/src/orb_slam_2_ros/orb_slam2/Thirdparty/DBoW2/DBoW2/BowVector.h:14,
                 from /home/jessi/catkin_ws/src/orb_slam_2_ros/orb_slam2/include/Frame.h:27,
                 from /home/jessi/catkin_ws/src/orb_slam_2_ros/orb_slam2/include/MapPoint.h:25,
                 from /home/jessi/catkin_ws/src/orb_slam_2_ros/orb_slam2/include/KeyFrame.h:24,
                 from /home/jessi/catkin_ws/src/orb_slam_2_ros/orb_slam2/include/LoopClosing.h:24,
                 from /home/jessi/catkin_ws/src/orb_slam_2_ros/orb_slam2/src/LoopClosing.cc:21:
/usr/include/c++/9.2.0/bits/stl_map.h: In instantiation of ‘class std::map<ORB_SLAM2::KeyFrame*, g2o::Sim3, std::less<ORB_SLAM2::KeyFrame*>, Eigen::aligned_allocator<std::pair<const ORB_SLAM2::KeyFrame*, g2o::Sim3> > >’:
/home/jessi/catkin_ws/src/orb_slam_2_ros/orb_slam2/src/LoopClosing.cc:438:21:   required from here
/usr/include/c++/9.2.0/bits/stl_map.h:122:71: error: static assertion failed: std::map must have the same value_type as its allocator
  122 |       static_assert(is_same<typename _Alloc::value_type, value_type>::value,
      |                                                                       ^~~~~
In file included from /usr/include/c++/9.2.0/map:61,
                 from /home/jessi/catkin_ws/src/orb_slam_2_ros/orb_slam2/Thirdparty/DBoW2/DBoW2/BowVector.h:14,
                 from /home/jessi/catkin_ws/src/orb_slam_2_ros/orb_slam2/include/KeyFrame.h:25,
                 from /home/jessi/catkin_ws/src/orb_slam_2_ros/orb_slam2/include/MapPoint.h:24,
                 from /home/jessi/catkin_ws/src/orb_slam_2_ros/orb_slam2/include/Map.h:24,
                 from /home/jessi/catkin_ws/src/orb_slam_2_ros/orb_slam2/include/Optimizer.h:24,
                 from /home/jessi/catkin_ws/src/orb_slam_2_ros/orb_slam2/src/Optimizer.cc:21:
/usr/include/c++/9.2.0/bits/stl_map.h: In instantiation of ‘class std::map<ORB_SLAM2::KeyFrame*, g2o::Sim3, std::less<ORB_SLAM2::KeyFrame*>, Eigen::aligned_allocator<std::pair<const ORB_SLAM2::KeyFrame*, g2o::Sim3> > >’:
/home/jessi/catkin_ws/src/orb_slam_2_ros/orb_slam2/src/Optimizer.cc:818:37:   required from here
/usr/include/c++/9.2.0/bits/stl_map.h:122:71: error: static assertion failed: std::map must have the same value_type as its allocator
  122 |       static_assert(is_same<typename _Alloc::value_type, value_type>::value,
      |                                                                       ^~~~~
make[2]: *** [CMakeFiles/orb_slam2_ros.dir/build.make:102: CMakeFiles/orb_slam2_ros.dir/orb_slam2/src/LoopClosing.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [CMakeFiles/orb_slam2_ros.dir/build.make:206: CMakeFiles/orb_slam2_ros.dir/orb_slam2/src/Optimizer.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:250: CMakeFiles/orb_slam2_ros.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
cd /home/jessi/catkin_ws/build/orb_slam2_ros; catkin build --get-env orb_slam2_ros | catkin env -si  /usr/bin/make --jobserver-auth=3,4; cd -

@lennarthaller
Copy link
Collaborator

Thanks a lot!

@lennarthaller lennarthaller merged commit 1fe5d70 into appliedAI-Initiative:master Nov 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants