编译错误,更新了函数后还是报原来的函数未定义

The_King_Cloud 2012-07-17 06:55:30

int setOsdalpha(simplewidget_screen sws,int x, int y, int w, int h,int a)
{
_simplescreen *scrp = (_simplescreen *) sws;
unsigned short *ptr;
int i;
int j;
int fd;
fd = gOsdFd;

if (!scrp)
return SIMPLEWIDGET_FAILURE;

/* Does the clearing area fit on screen? */
if (y + h > scrp->h || x + w > scrp->w)
{
return SIMPLEWIDGET_FAILURE;
}
ptr = scrp->bufp + y * scrp->w + x;
if(a)
{
/*if(x==0&&w==SCREEN_WIDTH)
{
ptr = scrp->bufp+ y * scrp->w;
memset(ptr, 0xff, w *h* 2);
}
else*/
{
ptr = scrp->bufp + y * scrp->w + x;

for (i = 0; i < h; i++)
{
memset(ptr, 0x80, w * 2);

ptr += scrp->w;
}
}

struct fb_fix_screeninfo fixInfo;
if(ioctl(fd, FBIOGET_FSCREENINFO, &fixInfo) == -1)
{
printf("Failed ioctl FBIOGET_VSCREENINFO on %s\n", OSD_DEVICE);
close(fd);
return FALSE;
}

int s32Ret;
TDE_HANDLE s32Handle;
TDE_SURFACE_S stDst;
TDE_OPT_S stOpt = {0};
/* create a TDE job */
s32Handle = HI_TDE2_BeginJob();
if(HI_ERR_TDE_INVALID_HANDLE == s32Handle)
{
return -1;
}
u8 *pu8PhyAddr[2] = {NULL};
pu8PhyAddr[0] = (u8 *)fixInfo.smem_start;
pu8PhyAddr[1] = pu8PhyAddr[0]+SCREEN_WIDTH*SCREEN_HEIGHT*2;
/* destination bitmap info */
stDst.enColorFmt = TDE_COLOR_FMT_ARGB1555;
stDst.pu8PhyAddr = (u8 *)pu8PhyAddr[workingIdx]+y*SCREEN_WIDTH*2+x*2;
stDst.u16Width = w;
stDst.u16Height = h;

stDst.u16Stride = SCREEN_WIDTH*2;
s32Ret = HI_TDE2_SolidDraw(s32Handle, &stDst, stFillColor, &stOpt);
if(HI_SUCCESS != s32Ret)
{
printf("add soliddraw command failed!\n");
}
else
{
//printf("add soliddraw command success!\n");
}
/* submit the job */
HI_TDE2_EndJob(s32Handle, HI_FALSE, 0);
HI_TDE2_WaitForDone();
}
else
{
/*if(x==0&&w==SCREEN_WIDTH)
{
ptr = scrp->bufp+ y * scrp->w;
memset(ptr, 0, w *h* 2);
}
else*/
{
ptr = scrp->bufp + y * scrp->w + x;

for (i = 0; i < h; i++)
{
memset(ptr, 0, w * 2);

ptr += scrp->w;
}
}
}

return SIMPLEWIDGET_SUCCESS;
}
这是修改后的代码,这是编译器的错误信息
../../common/lib/debug/libui.a(ui.o): In function `setOsdalpha':
ui.c:(.text+0x3a68): undefined reference to `HI_API_TDE_BeginJob'
ui.c:(.text+0x3b10): undefined reference to `HI_API_TDE_SolidDraw'
ui.c:(.text+0x3b28): undefined reference to `HI_API_TDE_EndJob'
ui.c:(.text+0x3b2c): undefined reference to `HI_API_TDE_WaitForDone'
collect2: ld returned 1 exit status
make: *** [tm_ui] 错误 1

欢迎大家踊跃讨论啊,争取解决问题
...全文
209 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
The_King_Cloud 2012-07-18
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 的回复:]

HI_API_TDE_BeginJob之类的东东在哪里定义的?是否有函数库没有加入?
[/Quote]有的,hi_tde_api.h,这是头文件,具体实现封装在库里,libtde.a,使用makefile提供编译选项的
sadgod 2012-07-17
  • 打赏
  • 举报
回复
链接的时候找不到符号,你没有设置好链接库,如果是vc就是lib文件,如果是gcc就是so或者.a
xunxun 2012-07-17
  • 打赏
  • 举报
回复
命令行?

100%缺少链接库

检查HI_API_TDE_BeginJob那些在哪个库中
pathuang68 2012-07-17
  • 打赏
  • 举报
回复
HI_API_TDE_BeginJob之类的东东在哪里定义的?是否有函数库没有加入?

69,377

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧