rinning sleep() function in g++

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vini7
    New Member
    • Oct 2007
    • 1

    rinning sleep() function in g++

    hi

    I am using sleep function in a C++ program. when I compile this program using g++.I am getting followong error:

    Code:
    g++ samspec.cpp samspecCount.cpp -o samspec
    samspecCount.cpp: In function `void* Counter_fun(void*)':
    samspecCount.cpp:26: `sleep' undeclared (first use this function)
    samspecCount.cpp:26: (Each undeclared identifier is reported only once for each function it appears in.)
    I am using gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)

    I have also added #include<cstdli b>

    still I am getting this error.

    How to resolve this error.

    Vini7
    Last edited by numberwhun; Oct 8 '07, 12:44 PM. Reason: add code tags
  • arne
    Recognized Expert Contributor
    • Oct 2006
    • 315

    #2
    Originally posted by vini7
    hi

    I am using sleep function in a C++ program. when I compile this program using g++.I am getting followong error:

    Code:
    g++ samspec.cpp samspecCount.cpp -o samspec
    samspecCount.cpp: In function `void* Counter_fun(void*)':
    samspecCount.cpp:26: `sleep' undeclared (first use this function)
    samspecCount.cpp:26: (Each undeclared identifier is reported only once for each function it appears in.)
    I am using gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)

    I have also added #include<cstdli b>

    still I am getting this error.

    How to resolve this error.

    Vini7

    Try
    [CODE=c]
    #include <unistd.h>
    [/CODE]

    HTH,
    arne

    Comment

    Working...