|
怎么才能在程序中调用mdelay/udelay/ndelay函数?
// main.c
#include <stdio.h>
#include <string.h>
#include <asm/delay.h>
#include <linux/delay.h>
int main()
{
fprintf(stdout,"delay start.\n");
mdelay(100);
fprintf(stdout,"delay end.\n");
return 1;
}
// compile main.c
xxx@xxx:~/workspace/mdelay$ gcc -I/usr/src/linux-headers-2.6.27-14-generic/include -omdelay main.c
/tmp/cciw39Rj.o: In function `main':
main.c.text+0x47): undefined reference to `__const_udelay'
collect2: ld 返回 1
xxx@xxx:~/workspace/mdelay$ |
|