- UID
- 134136
- 性别
- 男
|
关于#include <sys/alt_timestamp.h>头文件
#include <stddef.h> #include <stdio.h> #include <sys/alt_timestamp.h> #include <sys/alt_alarm.h> #include <alt_types.h> #include <system.h>
int main (void) { alt_u32 time1; alt_u32 time2; alt_u32 time3; alt_u32 i; if (alt_timestamp_start() < 0) { printf ("No timestamp device available"); } else { time1 = alt_timestamp(); i=0; while(i<2000) i++;
time2 = alt_timestamp(); i=0; while(i<50000) i++; time3 = alt_timestamp();
printf ("time in func1 = %d ticks\n",( int)(time2-time1));
printf ("time in func2 = %d ticks\n",(int)(time3-time2));
printf ("Number of ticks per second = %u\n",(unsigned int) alt_timestamp_freq()); } return 0; } 当我编译的时候怎么会出现找没有定义过alt_timestamp_start()。alt_timestamp_freq()等函数 错误显示如下:undefined reference to `alt_timestamp' ../hello_world.c:25: undefined reference to `alt_timestamp' 等的错误。 |
|