找回密码
 注册
搜索
查看: 701|回复: 7

[讨论] 富贵文档第九章的《文本》第一个程序怎么编译通不过啊

[复制链接]
发表于 2010-5-7 13:10:29 | 显示全部楼层 |阅读模式
void mmi_myapp_entry(void)
{

EntryNewScreen(SCR_ID_MYAPP,mmi_myapp_exit, NULL, NULL);
entry_full_screen();
clear_screen();

stFontAttribute   f = {0};
f.size = LARGE_FONT;
gui_move_text_cursor(50,100);
gui_set_text_color(UI_COLOR_RED); /* 字体颜色*/
gui_set_font(f);
        gui_print_text((UI_string_type)GetString(STR_ID_MYAPP));
gui_BLT_double_buffer(0,0,UI_device_width - 1,UI_device_height - 1);
SetKeyHandler(GoBackHistory, KEY_RSK, KEY_EVENT_UP);
}
模拟器报错:
MyApp.c
E:\MTK6225\plutommi\mmi\MyApp\MyAppSrc\MyApp.c(74) : error C2275: 'stFontAttribute' : illegal use of this type as an expression
        e:\mtk6225\plutommi\mmi\miscframework\miscframeworkinc\pixcomfontengine.h(152) : see declaration of 'stFontAttribute'
E:\MTK6225\plutommi\mmi\MyApp\MyAppSrc\MyApp.c(74) : error C2146: syntax error : missing ';' before identifier 'f'
E:\MTK6225\plutommi\mmi\MyApp\MyAppSrc\MyApp.c(74) : error C2065: 'f' : undeclared identifier
E:\MTK6225\plutommi\mmi\MyApp\MyAppSrc\MyApp.c(74) : error C2059: syntax error : '{'
E:\MTK6225\plutommi\mmi\MyApp\MyAppSrc\MyApp.c(75) : error C2224: left of '.size' must have struct/union type
E:\MTK6225\plutommi\mmi\MyApp\MyAppSrc\MyApp.c(78) : warning C4047: 'function' : 'struct stFontAttribute *' differs in levels of indirection from 'int '
E:\MTK6225\plutommi\mmi\MyApp\MyAppSrc\MyApp.c(78) : warning C4024: 'gui_set_font' : different types for formal and actual parameter 1
Error executing cl.exe.

PC_Simulator.exe - 5 error(s), 2 warning(s)
发表于 2010-5-7 13:28:07 | 显示全部楼层
老实说,我佩服模拟器的程序,但是我不欣赏用模拟器
点评回复

使用道具 举报

发表于 2010-5-7 17:42:53 | 显示全部楼层
注意类型配对.
点评回复

使用道具 举报

 楼主| 发表于 2010-5-7 18:58:01 | 显示全部楼层
gui_set_font(&f);

这样改了以后还是有问题。
点评回复

使用道具 举报

发表于 2010-5-8 09:53:48 | 显示全部楼层
把如下一行放到函数的最前端。
stFontAttribute   f = {0};
点评回复

使用道具 举报

发表于 2010-5-9 06:54:21 | 显示全部楼层
开发新界面和新功能时,没有模拟器是不可想象的
点评回复

使用道具 举报

 楼主| 发表于 2010-5-10 19:19:17 | 显示全部楼层
搞定了

原来是没有包含头文件!!! 太失败了!!!
点评回复

使用道具 举报

发表于 2010-6-12 14:02:38 | 显示全部楼层
到底怎么弄的啊,我的也找不到那几个函数。
点评回复

使用道具 举报

高级模式
B Color Image Link Quote Code Smilies

本版积分规则

Archiver|手机版|小黑屋|52RD我爱研发网 ( 沪ICP备2022007804号-2 )

GMT+8, 2025-2-26 06:12 , Processed in 0.046749 second(s), 16 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表