'sleep' Was Not Declared In This Scope C++ Code Example


Example 1: error: ‘sleep’ was not declared in this scope

Solution: #include <unistd.h>  Include unistd.h header file will solve the error.  Explanation: "sleep" function in c++ context, include in header file "unistd.h" .  otherwise we can see compilation error like below.  prashad@ubuntu:~/test$ g++ open_videofile.cpp  `pkg-config --cflags --libs opencv` -g  open_videofile.cpp: In function ‘int main(int, char**): open_videofile.cpp:34:2: error: ‘sleep’ was not declared in this scope   sleep(5);   ^~~~~

Example 2: sleep not declared in this scope c++

" 's' should be in the form of uppercase in Sleep"

Comments

Popular posts from this blog

Chemistry - Bond Angles In NH3 And NCl3

Are Regular VACUUM ANALYZE Still Recommended Under 9.1?

Change The Font Size Of Visual Studio Solution Explorer