473,396 Members | 1,900 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

rinning sleep() function in g++

1
hi

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

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

I have also added #include<cstdlib>

still I am getting this error.

How to resolve this error.

Vini7
Oct 8 '07 #1
1 6959
arne
315 Expert 100+
hi

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

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

I have also added #include<cstdlib>

still I am getting this error.

How to resolve this error.

Vini7

Try
Expand|Select|Wrap|Line Numbers
  1. #include <unistd.h>
  2.  
HTH,
arne
Oct 8 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

12
by: Ryan Spencer | last post by:
Hello Everyone, I want to have a row of periods, separated by small, say, .5 second intervals between each other. Thus, for example, making it have the appearance of a progress "bar". ...
3
by: K Balusu | last post by:
Hi all, We have to develop a small engine which the client uses. It supposed to work like this. Our engine resides in a frame (frameA) which will be loaded only once and it provides set of...
21
by: Alo Sarv | last post by:
Hi From what I have understood from various posts in this newsgroup, writing event loops pretty much comes down to this: while (true) { handleEvents(); sleep(1); // or _sleep() or...
11
by: Yeounkun, Oh | last post by:
Hello. Sleep (x) function make a process sleep during x seconds. but, how to sleep during milliseconds... Pls. help me. Thank you. Regards.
10
by: Alfonso Morra | last post by:
Hi, I need help witht he sleep function as follows. I need to be write som code to do the ff: 1. creates a new thread 2. (in the new thread), Sleep for x milliseconds 3. (in the new thread),...
5
by: Sinan Nalkaya | last post by:
hello, i need a function like that, wait 5 seconds: (during wait) do the function but function waits for keyboard input so if you dont enter any it waits forever. i tried time.sleep() but when...
17
by: OlafMeding | last post by:
Below are 2 files that isolate the problem. Note, both programs hang (stop responding) with hyper-threading turned on (a BIOS setting), but work as expected with hyper-threading turned off. ...
2
by: fltcpt | last post by:
After reading the many posts on the newsgroup, I still disagree with the people who claim you will never need a sleep(), or that a sleep() is a bad idea, or that sleep() does not fit in the event...
2
by: The Last Ottoman | last post by:
Hi, I'm a student in Turkey... I used sleep() function in my second project, and I included <windows.h>, <time.h> and <iostream>... then, the function worked properly... After a while, my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.