Skip to content
Advertisement

OpenCV 2.4.11 Compilation For ROS ORB_SLAM2 Fails

I am trying to get orb_slam2_ros to compile and it needed an OpenCV version higher than 2.3. I have 4.2.0 but it doesn’t work but according to ROS, it has been tested to work on 2.4.11. Here is what I did:

  • Download the source zip file.
  • Extract it.
  • Go into the directory and create a build folder.
  • Go into the build folder and run cmake ... There is gives me this:
JavaScript

Am I compiling it wrong? If not, how can I resolve this error?

Advertisement

Answer

You need to change opencv2.4.13/cmake/OpenCVDetectCXXCompiler.cmake (not sure which line) dumpversion to dumpfullversion

Explanation is that

In gcc with higher version, dumpversion function can’t get true full version number of compiler so that cmake progress will fail

Recommendation: On github, there plenty of refactored versions for both 4.2.0 and others. I recommend to upgrade to newer OpenCV versions for orb_slam_ros. Cmake lists and source files should be changed respectively.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement