请选择 进入手机版 | 继续访问电脑版
返回官网官方微博

麦步社区-论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

搜索
热搜: MAI 表盘
查看: 5922|回复: 12

定时器应用模拟时出现的问题

[复制链接]

5

主题

21

帖子

248

麦力

精华
0
阅读权限
20
在线时间
9 小时

发表于 2017-4-12 15:30:03 | 显示全部楼层 |阅读模式
下载了定时器应用的源码,在开发环境模拟时,出现一些警告,但不影响实现。好像说头文件重新定义了,不知道这会不会影响以后的开发呢。求大神解答。具体如下:

In file included from E:\MAIBU\VisualMWatch_W64\watchapp_time_keeper.c:30:0:
E:\MAIBU\VisualMWatch_W64\maibu_res.h:3:0: warning: "IMAGE_ICON" redefined
#define  IMAGE_ICON  5001
^
In file included from E:/MAIBU/VisualMWatch_W64/mbcc/x86_64-w64-mingw32/include/windows.h:72:0,
                 from E:/MAIBU/VisualMWatch_W64/mbcc/x86_64-w64-mingw32/include/winsock2.h:23,
                 from .\mbcc\include/curl/multi.h:51,
                 from .\mbcc\include/curl/curl.h:1561,
                 from .\mbcc\include/os_comm.h:19,
                 from .\mbcc\include/maibu_sdk.h:23,
                 from E:\MAIBU\VisualMWatch_W64\watchapp_time_keeper.c:29:
.\mbcc\include/winuser.h:3441:0: note: this is the location of the previous definition
#define IMAGE_ICON 1

5

主题

21

帖子

248

麦力

精华
0
阅读权限
20
在线时间
9 小时

 楼主| 发表于 2017-4-12 15:31:49 | 显示全部楼层
我把源码的这部分删掉了
#ifdef LINUX
#include <unistd.h>
#include <time.h>
#include <pthread.h>
#include "linux_screen_show.h"
#include "os_store_manage.h"
#include "os_time.h"
#include "os_res_bitmap.h"
#include "os_comm.h"
#include "res_user_bitmap.h"
#include "os_sys_notify.h"
#include "window_stack.h"
#include "window.h"
#include "screen_show.h"
#include "matrix.h"
#include "plug_status_bar.h"
#include "res_bitmap_base.h"
#include "os_motor.h"
#include "os_lights.h"
#else

5

主题

21

帖子

248

麦力

精华
0
阅读权限
20
在线时间
9 小时

 楼主| 发表于 2017-4-12 15:35:24 | 显示全部楼层
还删了主程序的这部分,不删除的话模拟不了。不知道是哪里出问题了
#ifdef LINUX       
        /*非APP编写*/       
        screen_init(SCREEN_ROW_NUMS,SCREEN_COL_NUMS);
        os_store_manage_init();       
        window_stack_init();
        os_comm_init();
#endif
#ifdef LINUX

        /*非APP编写*/       
        while (1)
        {
                char input;       
       
                /*输入操作*/
                scanf("%c", &input);
                if (input == 'd')
                {
                        window_stack_button(ButtonIdDown);       
                }
                else if (input == 'u')
                {
                        window_stack_button(ButtonIdUp);       
                }       
                else if (input == 's')
                {
                        window_stack_button(ButtonIdSelect);               
                }
                else if (input == 'b')
                {
                        window_stack_button(ButtonIdBack);               
                }
                else if (input == 'q')
                {
                        break;
                }
       
        }       

        window_stack_destory();
        screen_destory();
        os_store_manage_destory();
#endif

5

主题

21

帖子

248

麦力

精华
0
阅读权限
20
在线时间
9 小时

 楼主| 发表于 2017-4-12 15:38:57 | 显示全部楼层
补充一点,完全没有更改源程序,运行后是显示这样的错误。
E:\MAIBU\VisualMWatch_W64\watchapp_time_keeper.c:35:27: fatal error: os_res_bitmap.h: No such file or directory
#include "os_res_bitmap.h"
                           ^
compilation terminated.
'mbcc\bin\mw.exe' 不是内部或外部命令,也不是可运行的程序
或批处理文件。

66

主题

915

帖子

1万

麦力

精华
8
阅读权限
80
在线时间
1040 小时

麦步极客实验室麦步增强版用户

发表于 2017-4-12 15:47:48 来自手机 | 显示全部楼层
在json里把图标名改成image_icon1,c文件里对应也改了ff

66

主题

915

帖子

1万

麦力

精华
8
阅读权限
80
在线时间
1040 小时

麦步极客实验室麦步增强版用户

发表于 2017-4-12 15:48:39 来自手机 | 显示全部楼层
#ifdef和#endif要成对的删

5

主题

21

帖子

248

麦力

精华
0
阅读权限
20
在线时间
9 小时

 楼主| 发表于 2017-4-12 16:10:58 | 显示全部楼层
qs100371 发表于 2017-4-12 15:47
在json里把图标名改成image_icon1,c文件里对应也改了ff

json中有一段这样的定义
"resources": [
      {
        "type": "bmp",
        "name": "IMAGE_ICON",
        "file": "timer_logo.bmp"
      },
但是我在源码中没有找到调用IMAGE_ICON的地方,在resource中IMAGE_ICON的图标是应用的图标,不是图层的图标。
现在脑袋好乱啊

66

主题

915

帖子

1万

麦力

精华
8
阅读权限
80
在线时间
1040 小时

麦步极客实验室麦步增强版用户

发表于 2017-4-12 16:47:01 | 显示全部楼层
把json里改了就行了

23

主题

1532

帖子

9071

麦力

精华
0
阅读权限
80
在线时间
103 小时

发表于 2017-4-14 00:10:33 | 显示全部楼层
支持开发者

5

主题

21

帖子

248

麦力

精华
0
阅读权限
20
在线时间
9 小时

 楼主| 发表于 2017-4-14 16:22:56 | 显示全部楼层
qs100371 发表于 2017-4-12 16:47
把json里改了就行了

不太明白,能具体说下嘛?
是改红色字体那里,还是绿色字体
我改过,警告没有消失
{
  "uuid": "6ea03a96b2638c393498f4ce79d737de",
  "name": "定时器",
  "icon": "IMAGE_ICON",
  "version": "1.1.2",
  "watchface": "false",
  "resources": [
      {
        "type": "bmp",
        "name": "IMAGE_ICON",
        "file": "timer_logo.bmp"
      },
      {
        "type": "bmp",
        "name": "RES_BITMAP_TIMER_CHOOSE_OFF",
        "file": "timer_choose_off.bmp"
      },
      {
        "type": "bmp",
        "name": "RES_BITMAP_TIMER_SET_BG",
        "file": "timer_set_bg.bmp"
      },
      {
        "type": "bmp",
        "name": "RES_BITMAP_TIMER_USER_BELL",
        "file": "timer_user_bell.bmp"
      },
          {
        "type": "bmp",
        "name": "RES_BITMAP_TIMER_SYS_BELL",
        "file": "timer_sys_bell.bmp"
      },
      {
        "type": "bmp",
        "name": "RES_BITMAP_TIMER_CHOOSE_ON",
        "file": "timer_choose_on.bmp"
      }
      ]
      }
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|麦步官方论坛 ( 粤ICP备12052190号  

GMT+8, 2024-3-29 22:01 , Processed in 0.097972 second(s), 25 queries .

Powered by Discuz! X3.2

© 2012-2021 Comsenz Inc.

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