Answers for "sleep not declared in this scope c++"

C++
0

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);
  ^~~~~
Posted by: Guest on September-29-2020
0

sleep not declared in this scope c++

" 's' should be in the form of uppercase in Sleep"
Posted by: Guest on December-15-2020

Code answers related to "sleep not declared in this scope c++"

Browse Popular Code Answers by Language