Skip to content

Fix many errors: ‘usleep’ was not declared#932

Open
booiljung wants to merge 1 commit into
raulmur:masterfrom
booiljung:master
Open

Fix many errors: ‘usleep’ was not declared#932
booiljung wants to merge 1 commit into
raulmur:masterfrom
booiljung:master

Conversation

@booiljung

@booiljung booiljung commented Aug 17, 2020

Copy link
Copy Markdown

There are many compile time errors. This PR fixes these errors.

/home/booil/linspace/orbslam/ORB_SLAM2/src/LoopClosing.cc: In member function ‘void ORB_SLAM2::LoopClosing::Run()’:
/home/booil/linspace/orbslam/ORB_SLAM2/src/LoopClosing.cc:84:9: error: ‘usleep’ was not declared in this scope
         usleep(5000);
         ^~~~~~
/home/booil/linspace/orbslam/ORB_SLAM2/src/LoopClosing.cc:84:9: note: suggested alternative: ‘fseek’
         usleep(5000);
         ^~~~~~
         fseek
/home/booil/linspace/orbslam/ORB_SLAM2/src/LoopClosing.cc: In member function ‘void ORB_SLAM2::LoopClosing::CorrectLoop()’:
/home/booil/linspace/orbslam/ORB_SLAM2/src/LoopClosing.cc:416:20: warning: use of an operand of type ‘bool’ in ‘operator++’ is deprecated [-Wdeprecated]
         mnFullBAIdx++;
                    ^~
/home/booil/linspace/orbslam/ORB_SLAM2/src/LoopClosing.cc:428:9: error: ‘usleep’ was not declared in this scope
         usleep(1000);
         ^~~~~~
/home/booil/linspace/orbslam/ORB_SLAM2/src/LoopClosing.cc:428:9: note: suggested alternative: ‘fseek’
         usleep(1000);
         ^~~~~~
         fseek
/home/booil/linspace/orbslam/ORB_SLAM2/src/LoopClosing.cc: In member function ‘void ORB_SLAM2::LoopClosing::RequestReset()’:
/home/booil/linspace/orbslam/ORB_SLAM2/src/LoopClosing.cc:630:9: error: ‘usleep’ was not declared in this scope
         usleep(5000);
         ^~~~~~
/home/booil/linspace/orbslam/ORB_SLAM2/src/LoopClosing.cc:630:9: note: suggested alternative: ‘fseek’
         usleep(5000);
         ^~~~~~
         fseek
/home/booil/linspace/orbslam/ORB_SLAM2/src/LoopClosing.cc: In member function ‘void ORB_SLAM2::LoopClosing::RunGlobalBundleAdjustment(long unsigned int)’:
/home/booil/linspace/orbslam/ORB_SLAM2/src/LoopClosing.cc:670:17: error: ‘usleep’ was not declared in this scope
                 usleep(1000);
                 ^~~~~~
/home/booil/linspace/orbslam/ORB_SLAM2/src/LoopClosing.cc:670:17: note: suggested alternative: ‘fseek’
                 usleep(1000);
                 ^~~~~~
                 fseek
/home/booil/linspace/orbslam/ORB_SLAM2/src/Tracking.cc: In member function ‘void ORB_SLAM2::Tracking::Reset()’:
/home/booil/linspace/orbslam/ORB_SLAM2/src/Tracking.cc:1512:13: error: ‘usleep’ was not declared in this scope
             usleep(3000);
             ^~~~~~
/home/booil/linspace/orbslam/ORB_SLAM2/src/Tracking.cc:1512:13: note: suggested alternative: ‘fseek’
             usleep(3000);
             ^~~~~~
             fseek

@linuxsen

linuxsen commented Jan 3, 2021

Copy link
Copy Markdown

add #include <unistd.h>
#include <stdio.h>
#include <stdlib.h> in "system.h"

@dcaffo98

Copy link
Copy Markdown

Same problem on Ubuntu 18.04 and @linuxsen 's fix worked for me! ( "System.h", not "system.h")

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.

4 participants