Orb_slam2: build.sh error

Created on 15 Oct 2018  Â·  4Comments  Â·  Source: raulmur/ORB_SLAM2

Simply installed depencies and run build.sh. got error:

/usr/local/include/eigen3/Eigen/src/Core/util/Constants.h:162:37: note: declared here
 EIGEN_DEPRECATED const unsigned int AlignedBit = 0x80;
                                     ^~~~~~~~~~
/home/jintain/work/codes/slam/ORB_SLAM2/src/Tracking.cc: In member function ‘void ORB_SLAM2::Tracking::Reset()’:
/home/jintain/work/codes/slam/ORB_SLAM2/src/Tracking.cc:1512:24: error: ‘usleep’ was not declared in this scope
             usleep(3000);
                        ^
CMakeFiles/ORB_SLAM2.dir/build.make:296: recipe for target 'CMakeFiles/ORB_SLAM2.dir/src/Viewer.cc.o' failed
make[2]: *** [CMakeFiles/ORB_SLAM2.dir/src/Viewer.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CMakeFiles/ORB_SLAM2.dir/build.make:88: recipe for target 'CMakeFiles/ORB_SLAM2.dir/src/LocalMapping.cc.o' failed
make[2]: *** [CMakeFiles/ORB_SLAM2.dir/src/LocalMapping.cc.o] Error 1
CMakeFiles/ORB_SLAM2.dir/build.make:101: recipe for target 'CMakeFiles/ORB_SLAM2.dir/src/LoopClosing.cc.o' failed
make[2]: *** [CMakeFiles/ORB_SLAM2.dir/src/LoopClosing.cc.o] Error 1
CMakeFiles/ORB_SLAM2.dir/build.make:75: recipe for target 'CMakeFiles/ORB_SLAM2.dir/src/Tracking.cc.o' failed
make[2]: *** [CMakeFiles/ORB_SLAM2.dir/src/Tracking.cc.o] Error 1
CMakeFiles/ORB_SLAM2.dir/build.make:62: recipe for target 'CMakeFiles/ORB_SLAM2.dir/src/System.cc.o' failed
make[2]: *** [CMakeFiles/ORB_SLAM2.dir/src/System.cc.o] Error 1
CMakeFiles/Makefile2:257: recipe for target 'CMakeFiles/ORB_SLAM2.dir/all' failed
make[1]: *** [CMakeFiles/ORB_SLAM2.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

It's this a bug or my mistake for missed something?

Most helpful comment

The error is caused by a missing header inclusion, unistd.h is missing. This has been discussed before. Solution given here:

Put #include <unistd.h> in System.h.

All 4 comments

my mistake is the same as yours,but the"EIGEN_DEPRECATED const unsigned int AlignedBit = 0x80"is bug?

The error is caused by a missing header inclusion, unistd.h is missing. This has been discussed before. Solution given here:

Put #include <unistd.h> in System.h.

Problem solved, thanks.

Hi. I had a similar or the same problem. So I tried the solution above ('Put #include in System.h.' from cbachhuber) but it didn't help.
But: after reading the following post I tried to Downgrade the Eigen to 3.2 and all the problems magically dissappeared :)
https://github.com/raulmur/ORB_SLAM2/issues/317

Was this page helpful?
0 / 5 - 0 ratings

Related issues

angussmitchell picture angussmitchell  Â·  5Comments

sunstarchan picture sunstarchan  Â·  4Comments

balzar29 picture balzar29  Â·  4Comments

Gaoxiang-Zhang picture Gaoxiang-Zhang  Â·  3Comments

kilimeters picture kilimeters  Â·  3Comments