'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

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable