LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   How to link to reference linux timer calls? Undefined --bad_delay for udelay() (https://www.linuxquestions.org/questions/programming-9/how-to-link-to-reference-linux-timer-calls-undefined-bad_delay-for-udelay-417064/)

pat_and_cami 02-19-2006 01:22 AM

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

XavierP 02-19-2006 06:30 PM

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


All times are GMT -5. The time now is 11:21 PM.