Running sleep() function on g++
hi
I am using sleep() function for wait for 1 second.I tried it with gcc and its working properly.But when I used this sleep() function in c++ program and compile with following function then it is giving error as:
[vineeta@vineeta vineeta]$ g++ thread2.cpp -o thread -lpthread
thread2.cpp: In function `void* fun_count(void*)':
thread2.cpp:16: `sleep' undeclared (first use this function)
thread2.cpp:16: (Each undeclared identifier is reported only once for each
function it appears in.)
Why I am grtting this error????
Please reply