MTK 指示错误U8类型非法定义

wuanan8321 2011-01-15 03:41:41
做富贵的文档的练习时,定义了U8类型的变量。
但是却被报错成非法定义:
贴出来给大家围观。。。。。。。。

定义变量:
void mmi_myapp_entry(void)
{
#ifdef __SO_HELLOWORLD__
UI_filled_area filler = {0}; //以颜色为背景的显示方法。
static color g_colors[3] = {{255,0,0},{0,255,0},{0,0,255}};
static U8 perc[2] = {30,70};
gradient_color gc = {g_colors,perc,3}; //结构体, 递进绘画对于 颜色的设置。
//color Board_color_myappp = {0,0,255,255};
CONST_HARDWARE color Board_color_myappp = {0,0,255,100};


gdi_handle base_layer; //基础层,有句柄就自动创建

S32 layer_offset_x = 20,layer_offset_y = 20;
color mycolor = {100,103,100,100};

S32 x,y,w,h;

stFontAttribute f = {0};
f.size = LARGE_FONT;
f.oblique = 1;

U8 myU8Symble;
U8 myU8Symble2;


/* Code Body */

EntryNewScreen(SCR_MY_APP_MAIN,NULL,mmi_myapp_entry,NULL);
//强制进入下一个程序,关闭上一个,自动的方式

entry_full_screen(); //全屏显示
clear_screen(); //清屏


//gif animation
//gdi_anim_draw_id(0,0,IMG_ID_PHNSET_ON_0,&my_anim);

//draw image 大的浅色的图作为背景。
//gdi_image_draw_id(30,200,IMAGE_MY_APP_HELLO2);
//gdi_image_draw_id(0,0,IMAGE_MY_APP_FIRST); ----240*300


//draw background
//filler.flags = UI_FILLED_AREA_TYPE_COLOR|UI_FILLED_AREA_DOUBLE_BORDER|UI_FILLED_AREA_SHADOW; //单一颜色,双边框,单阴影
//filler.flags = UI_FILLED_AREA_TYPE_GRADIENT_COLOR|UI_FILLED_AREA_DOUBLE_BORDER|UI_FILLED_AREA_SHADOW; //递进颜色,双边框,单阴影
filler.flags = UI_FILLED_AREA_TYPE_GRADIENT_COLOR|UI_FILLED_AREA_VERTICAL_FILL|UI_FILLED_AREA_DOUBLE_BORDER|UI_FILLED_AREA_SHADOW;
//filler.b =(U8*) GetImage( IMAGE_MY_APP_HELLO);
filler.gc = &gc;
//filler.c = UI_COLOR_GREY;
filler.border_color = UI_COLOR_GREEN; //边框颜色只能能够是程序所指定的一些颜色,其他颜色如蓝色都没有
filler.shadow_color = UI_COLOR_3D_FILLER; //阴影颜色
gui_draw_filled_area(5,5,235,315,&filler);
//draw background for image END

//draw my_layer 绘制我自己的层
gdi_layer_create(layer_offset_x,layer_offset_y,200,200,&my_layer);
gdi_layer_set_active(my_layer);
//对于图层的清理,否则会出现不想要的颜色
gdi_layer_clear(GDI_COLOR_BLUE);
gdi_layer_set_source_key(TRUE, GDI_COLOR_BLUE);
gdi_layer_set_opacity(TRUE ,200); //设置透明度
//gdi_layer_set_clip(40,25 ,100 ,100); //左上,右下的坐标确定位置。相对于屏幕的剪切

//我自己的层中绘制图片
gdi_image_draw_id(40,25,IMAGE_MY_APP_HELLO);



//draw rangle
gui_draw_rectangle(40,25,60,60,UI_COLOR_RED);
gui_fill_rectangle(41,26,58,58,UI_COLOR_GREY);
//draw rangle end


//draw text
gui_set_text_border_color(UI_COLOR_GREEN);
gui_measure_string((UI_string_type)GetString(STR_MY_APP_HELLO),&w,&h); //测量字串宽高、

gui_set_text_color(UI_COLOR_RED); //文本颜色
gui_set_font(&f);

x = (UI_device_width-w)/2-layer_offset_x;
y = (UI_device_height-h)/2-layer_offset_y;


gui_move_text_cursor(x,y); //移动text文本的光标位置
gui_print_bordered_text((UI_string_type)GetString(STR_MY_APP_HELLO));

myU8Symble = 1;
myU8Symble2 = 2;//----------------------------------------------这里报错
// (U8) ((enfb_size >> 24) & 0xff));
//gdi_draw_line_style(73,176,176,176,UI_COLOR_BLACK ,myU8Symble,&myU8Symble2);

/*
gdi_draw_line_style(73,176,176,y+h+2,
  gdi_act_color_from_rgb(100,255,0,0),
  sizeof(dotted_line_bitvalues),
  dotted_line_bitvalues);
*/

//draw base layer 基础层的绘画
gdi_layer_get_base_handle(&base_layer);
gdi_layer_set_active(base_layer);
gdi_layer_set_blt_layer(base_layer,my_layer,NULL,NULL); //对于图层的合并

//双缓冲显示
gui_BLT_double_buffer(0,0,UI_device_width-1,UI_device_height-1); //双缓冲绘画
gdi_layer_free(my_layer);
/*
gdi_layer_free(my_layer);
gdi_layer_free(base_layer);
*/
gui_BLT_double_buffer(0,0,UI_device_width-1,UI_device_height-1); //双缓冲绘画
SetKeyHandler(GoBackHistory,KEY_RSK,KEY_LONG_PRESS); //KEY_EVENT_DOWN
//KEY_RSK右软键

#endif

}
错误信息:
myappsrc.c
E:\6253_09B_1012_1\plutommi\mmi\myapp\myappsrc\myappsrc.c(74) : error C2275: 'U8' : illegal use of this type as an expression
..\..\plutommi\mmi\Inc\MMIDataType.h(843) : see declaration of 'U8'
E:\6253_09B_1012_1\plutommi\mmi\myapp\myappsrc\myappsrc.c(74) : error C2146: syntax error : missing ';' before identifier 'myU8Symble'
E:\6253_09B_1012_1\plutommi\mmi\myapp\myappsrc\myappsrc.c(74) : error C2065: 'myU8Symble' : undeclared identifier
E:\6253_09B_1012_1\plutommi\mmi\myapp\myappsrc\myappsrc.c(75) : error C2275: 'U8' : illegal use of this type as an expression
..\..\plutommi\mmi\Inc\MMIDataType.h(843) : see declaration of 'U8'
E:\6253_09B_1012_1\plutommi\mmi\myapp\myappsrc\myappsrc.c(75) : error C2146: syntax error : missing ';' before identifier 'myU8Symble2'
E:\6253_09B_1012_1\plutommi\mmi\myapp\myappsrc\myappsrc.c(75) : error C2065: 'myU8Symble2' : undeclared identifier
E:\6253_09B_1012_1\plutommi\mmi\myapp\myappsrc\myappsrc.c(156) : warning C4047: 'function' : 'unsigned int ' differs in levels of indirection from 'void *'
E:\6253_09B_1012_1\plutommi\mmi\myapp\myappsrc\myappsrc.c(156) : warning C4024: 'gdi_layer_set_blt_layer_ext' : different types for formal and actual parameter 3
E:\6253_09B_1012_1\plutommi\mmi\myapp\myappsrc\myappsrc.c(156) : warning C4047: 'function' : 'unsigned int ' differs in levels of indirection from 'void *'
E:\6253_09B_1012_1\plutommi\mmi\myapp\myappsrc\myappsrc.c(156) : warning C4024: 'gdi_layer_set_blt_layer_ext' : different types for formal and actual parameter 4
E:\6253_09B_1012_1\plutommi\mmi\myapp\myappsrc\myappsrc.c(200) : warning C4113: 'void (__cdecl *)()' differs in parameter lists from 'void (__cdecl *)(void )'
Error executing cl.exe.

MoDIS.exe - 6 error(s), 5 warning(s)
...全文
282 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
wuanan8321 2011-03-17
  • 打赏
  • 举报
回复
把U8的定义放在前面

566

社区成员

发帖
与我相关
我的任务
社区描述
英特尔® 边缘计算,聚焦于边缘计算、AI、IoT等领域,为开发者提供丰富的开发资源、创新技术、解决方案与行业活动。
社区管理员
  • 英特尔技术社区
  • shere_lin
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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