我编了一个简单的程序想试一下定时器,编译没问题,但是下载到VxSim的时候就出现这样的问题,这几个函数
是在timerLib中定义的,但是我 include timerLib.h或timerLib.c就编译不过去。请教各位大侠这是什么原因呢?
版本是tornado 2.0,代码附后。
Unresolved symbols encountered while
Errors while downloading E:/test/SIMNTgnu/Project0.out:
_timer_connect
_timer_settime
_timer_create
#include "vxWorks.h"
#include "wdLib.h"
#include "stdlib.h"
#include "taskLib.h"
#include "logLib.h"
#include "intLib.h"
#include "netLib.h"
#include "stdio.h"
#include "stdlib.h"
#include "sysLib.h"
#include "memLib.h"
#include "semLib.h"
#include "cacheLib.h"
#include "sys/ioctl.h"
#include "etherLib.h"
#include "msgQLib.h"
#include "tickLib.h"
#include "signal.h"
#include "timers.h"
#include "sigLib.h"
#include "time.h"
void runfunction(void);
void addOct(int a);
timer_t mytimer;
struct timespec timeValue;
struct timespec timeInterval;
struct itimerspec timeToSet;
void runfunction(void)
{
int m;
timeInterval.tv_sec=2;
timeInterval.tv_nsec=0;
timeValue.tv_nsec=0;
timeValue.tv_sec=2;
timeToSet.it_value=timeValue;
timeToSet.it_interval=timeInterval;
m=3;
/* 创建定时器 */
if(timer_create(CLOCK_REALTIME,0,&mytimer)==ERROR)
return ;
/* 用户程序与定时器相连 */
if(timer_connect(mytimer,(VOIDFUNCPTR)addOct,m)==ERROR)
return;
/* 设置定时器值 */
if(timer_settime(mytimer,0,&timeToSet,0)==ERROR)
return;
}
void addOct(int a)
{
printf("***The answer is %d;\n\n",a);
timer_settime(mytimer,0,&timeToSet,0);
}