麦步社区-论坛

标题: 求助,第一次编程编译都过不去 [打印本页]

作者: dustin134    时间: 2016-8-26 09:49
标题: 求助,第一次编程编译都过不去
把缤纷多显程序三个文件原封不动的考进去,编译都通不过,错误如下:
D:\VisualMWatch_W64_v14\VisualMWatch_W64\watcheface_show_more.c: In function 'init_window':
D:\VisualMWatch_W64_v14\VisualMWatch_W64\watcheface_show_more.c:309:72: warning: passing argument 5 of 'display_target_layerText' from incompatible pointer type
  display_target_layerText(p_window,&temp_frame,GAlignRight,GColorWhite,&g_show_more_str_battery_percent,U_ASCII_ARIAL_12);
                                                                        ^
D:\VisualMWatch_W64_v14\VisualMWatch_W64\watcheface_show_more.c:263:9: note: expected 'char *' but argument is of type 'char (*)[4]'
int32_t display_target_layerText(P_Window p_window,GRect  *temp_p_frame,enum GAlign how_to_align,enum GColor color,char * str,uint8_t font_type)
         ^
D:\VisualMWatch_W64_v14\VisualMWatch_W64\watcheface_show_more.c: In function 'data_handler_per_minute':
D:\VisualMWatch_W64_v14\VisualMWatch_W64\watcheface_show_more.c:419:34: warning: passing argument 2 of 'strcat' from incompatible pointer type
  strcat(g_show_more_str_altitude,&MMM);
                                  ^
In file included from D:\VisualMWatch_W64_v14\VisualMWatch_W64\watcheface_show_more.c:3:0:
D:/VisualMWatch_W64_v14/VisualMWatch_W64/mbcc/x86_64-w64-mingw32/include/string.h:52:18: note: expected 'const char * __restrict__' but argument is of type 'char (*)[2]'
   char * __cdecl strcat(char * __restrict__ _Dest,const char * __restrict__ _Source);
                  ^
D:\VisualMWatch_W64_v14\VisualMWatch_W64\watcheface_show_more.c: In function 'main':
D:\VisualMWatch_W64_v14\VisualMWatch_W64\watcheface_show_more.c:675:37: warning: passing argument 1 of 'maibu_comm_register_phone_callback' from incompatible pointer type
  maibu_comm_register_phone_callback(get_city_info_callback);
                                     ^
In file included from .\mbcc\include/maibu_sdk.h:23:0,
                 from D:\VisualMWatch_W64_v14\VisualMWatch_W64\watcheface_show_more.c:5:
.\mbcc\include/os_comm.h:306:6: note: expected 'CBCommPhone' but argument is of type 'void (*)(enum ERequestPhone,  void *)'
void maibu_comm_register_phone_callback(CBCommPhone phone_callback);
      ^



作者: dustin134    时间: 2016-8-26 09:54
需要在源代码main函数中开头处添加simulator_init()接口,以及在return前添加simulator_wait()接口,难道是这个原因?
作者: dustin134    时间: 2016-8-26 09:57
果真如此
作者: dualxu    时间: 2016-8-26 10:36
dustin134 发表于 2016-8-26 09:54
需要在源代码main函数中开头处添加simulator_init()接口,以及在return前添加simulator_wait()接口,难道是 ...

和simulator_xxx 没关系的
作者: dualxu    时间: 2016-8-26 10:37
编译应该可以通过吧,这些是一些警告,可以忽略
作者: dustin134    时间: 2016-8-26 10:53
dualxu 发表于 2016-8-26 10:36
和simulator_xxx 没关系的

加上了那两个函数就通过了,不过看了一下源程序,貌似很难看懂,还有好像GPS的调用是没5分钟调用一次,这么频繁啊,不是说15分钟吗
作者: dustin134    时间: 2016-8-26 10:55
dualxu 发表于 2016-8-26 10:37
编译应该可以通过吧,这些是一些警告,可以忽略

//判断是否距离上次成功获得数据超过5分钟
        if(get_time_out_flag(5)||(g_weather_bmp_key == -1))
        {
                //请求GPS数据并注册GPS数据请求超时回调
                request_get_city_info();
               
        }
作者: tda8361    时间: 2016-8-26 21:51
楼主模拟时天气,温度,能显示吗
作者: dustin134    时间: 2016-8-26 22:06
tda8361 发表于 2016-8-26 21:51
楼主模拟时天气,温度,能显示吗

没有显示,毕竟只是模拟,没有与手机相连啊




欢迎光临 麦步社区-论坛 (http://203.195.186.190/) Powered by Discuz! X3.2