LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
LinkBack Search this Thread
Old 10-25-2006, 08:58 AM   #1
arabindav
LQ Newbie
 
Registered: Oct 2006
Posts: 9

Rep: Reputation: 0
Question Linux timers


Hello,

I need to use four timers in my application. I am using Redhat Linux 9.0.

I came across functions like timer_create(), timer_delete()... But when I tried to call these function from my application there was linking error.

/tmp/cc0r6EtC.o(.text+0x3e): In function `main':
: undefined reference to `timer_create'

I have included following header files:

#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <signal.h>
#include <unistd.h>
#include <sys/types.h>
#include <error.h>
#include <sys/syscall.h>

Here are my questions.

1. Am I taking the correct direction? I mean using timer_create() and other related functions.

2. Am I missing any specific header file? Do I have to link to some library? Or simply the source code for the function is missing?

3. If the source is missing, where I can find it.

4. It would be great if you could direct me to some tutorials or something that is helpful in this regard.

5. I do not think setitimer() and getitime() going to help me. I have to have different timer values for all the timers and on expiration I need to call different functions. Any thoughts?

Your help is highly appreciated.

Regards.
 
Old 10-25-2006, 11:19 AM   #2
introuble
Member
 
Registered: Apr 2004
Distribution: Debian -unstable
Posts: 700

Rep: Reputation: 31
avancedlinuxprogramming.com

Also, why didn't you post this in the "programming" sub-forum?
 
Old 05-20-2011, 06:29 AM   #3
shakthi
LQ Newbie
 
Registered: May 2011
Posts: 11

Rep: Reputation: 0
hi,

while compiling add -lrt then u wont get those linking errors

example program name - shakthi then try,

gcc -lrt shakthi.c

if u add any pthreads, then try,

gcc -lrt -lpthread shakthi.c

warms and regards,
shakthi
 
Old 05-20-2011, 07:33 AM   #4
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 9,358
Blog Entries: 1

Rep: Reputation: 755Reputation: 755Reputation: 755Reputation: 755Reputation: 755Reputation: 755Reputation: 755
Hi,

Welcome to LQ!

Quote:
Originally Posted by shakthi View Post
hi,

while compiling add -lrt then u wont get those linking errors

example program name - shakthi then try,

gcc -lrt shakthi.c

if u add any pthreads, then try,

gcc -lrt -lpthread shakthi.c

warms and regards,
shakthi
Do not resurrect old threads!
Look at the original post(OP) date. This thread is almost 5 1/2 years old so do not expect feedback or reply since neither member have participated in years.

Plus, please spell out your words. No SMS text or tech speak since it is difficult enough to understand posts between members. By proper presentation then everyone will understand each other.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Linux: High-Res Timers and Tickless Kernel LXer Syndicated Linux News 0 06-24-2006 07:21 AM
C - Linux - Timers - How? drigz Programming 6 08-30-2004 02:36 PM
Pls Help, Singals and Timers problem in RedHat Linux 7.3 kumarnine Programming 2 08-26-2004 09:16 AM
timers is user space in linux gooner Programming 0 06-07-2004 03:52 AM
Help with Linux timers samble Programming 8 02-07-2004 10:54 PM


All times are GMT -5. The time now is 03:45 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration