LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 02-19-2006, 02:22 AM   #1
pat_and_cami
LQ Newbie
 
Registered: Feb 2006
Posts: 16

Rep: Reputation: 0
How to link to reference linux timer calls? Undefined --bad_delay for udelay()


I wrote a program on my pc, where I am trying to print a line every 3 seconds.
---
#include <stdio.h>
#include <string.h>
#include <asm/delay.h>

int main ()
{
for(;
{
udelay(3000000);
printf ("Print this line every three seconds!!\n");
return 0;
}
}

I am getting a compile/link error saying that it cannot find --bad_udelay (which is reference in delay.h for my PC,

psullivan@linux:~> gcc homework1.c
/tmp/ccoWpKbA.o(.text+0xe1): In function `main':
homework1.c: undefined reference to `__bad_udelay'
collect2: ld returned 1 exit status
psullivan@linux:~>

What do I have to do to link in to get __bad_udelay? Do I have to create a make file to include the kernel or parts of the Linux kernel to do this? I currently do not have a make file and am unsure how it should look like.


Thanks,

Pat
 
Old 02-19-2006, 07:30 PM   #2
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Lubuntu
Posts: 19,176
Blog Entries: 4

Rep: Reputation: 430Reputation: 430Reputation: 430Reputation: 430Reputation: 430
Moved: This thread is more suitable in Programming and has been moved accordingly to help your thread/question get the exposure it deserves.
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Undefined reference, why? george_mercury Programming 4 05-07-2009 01:15 AM
Undefined Reference ChemicalBurn Programming 2 02-14-2005 04:01 AM
Hacking Win32 exe files ? (removing INT15 timer CALLS) for wine compatability qwijibow Linux - Software 5 06-24-2004 12:57 PM
Undefined reference error using gcc with Redhat Linux 9.0 armesk Programming 2 08-28-2003 07:42 AM
using timer for repeated function calls poojamanu Programming 1 04-09-2003 09:17 PM


All times are GMT -5. The time now is 07:28 PM.

Main Menu
Advertisement
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 Google+: linuxquestions
Open Source Consulting | Domain Registration