麦步社区-论坛

标题: 新人求解,按帮助文档搭建开发环境,模拟表盘报错 [打印本页]

作者: 王克_jRj95    时间: 2017-3-12 14:22
标题: 新人求解,按帮助文档搭建开发环境,模拟表盘报错
本帖最后由 王克_jRj95 于 2017-3-12 14:23 编辑

系统:win10
表盘模拟器


VisualMWatch_W32

模拟器路径 (结尾大图)


E:\VisualMWatch_W32

arm路径:(结尾大图)

C:\Program Files (x86)\GNU Tools ARM Embedded\4.7 2014q2\bin

系统环境变量path:


(结尾大图)

C:\Program Files (x86)\GNU Tools ARM Embedded\4.7 2014q2\bin;E:\VisualMWatch_W32\mbcc\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;%JAVA_HOME%\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;E:\AMULU\MYSQL\bin;%CATALINA_HOME%\lib;%CATALINA_HOME%\bin;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\


测试对象


卖萌天气表盘    来源于官方开源代码。


主函数代码:


int main()
{
        simulator_init();

        /*创建消息列表窗口*/
        P_Window p_window = init_window();
        /*放入窗口栈显示*/
        g_window_id = app_window_stack_push(p_window);
        
        //请求GPS数据并注册回调
        request_gps_info();
        
        /*注册接受手机数据回调函数*/
        maibu_comm_register_phone_callback(gps_info_callback);
               
        //test
        //char city_name[20] = "深圳";
        //request_weather_info(city_name);
        //maibu_comm_register_web_callback(weather_info_callback);

        uint32_t request_time = 15 * 60 * 1000;//默认5分钟请求数据
        if(get_date_flag() == false)
        {
                request_time = 15 * 60 * 1000;
        }

        if(strlen(g_city) == 0)
        {//在没有城市数据的情况下进行快速查询
                request_time = 5 * 1000;//在没有获取过数据的情况下5秒获取一次数据

                g_callback_request_flag = 1;//设置快速查询标志
        }
        
        app_service_timer_subscribe(request_time, app_weather_update_timer_callback, NULL);        
        /*注册一个事件通知回调,当有时间改变时,立即更新时间*/
        maibu_service_sys_event_subscribe(time_change);

        /*注册通讯结果回调*/
        maibu_comm_register_result_callback(weather_comm_result_callback);

        simulator_wait();
        return 0;

}


测试日志:   主要报错+详情

主要报错信息:(忽略warning)
生成资源文件...
not found file:.\build\maibu_code
create pack failed
正在编译...
readelf: Error: '.\build\maibu_code': No such file
正在打包...
not found file:.\build\maibu_code
create pack failed
正在编译...
E:\VisualMWatch_W32\new_weather_watchface.c: In function 'request_gps_info':
E:\VisualMWatch_W32\new_weather_watchface.c:594:2: error: too few arguments to function 'maibu_comm_request_phone'
mbcc\bin\mw.exe' 不是内部或外部命令,也不是可运行的程序
或批处理文件。

详情

生成资源文件...
-------------read appinfo.json-------------
uuid:39fe260221d9717da155d14404ca4054
app_id:33280
name:��������
icon:5001
version:127
watchface:0
sysapp:1
res_num:10
res:0, type:0, name:RES_BITMAP_WATCHFACE_WEATHER_BG, file:watchface-bg.bmp
res:1, type:0, name:RES_BITMAP_WATCHFACE_WEATHER_UPDATING, file:updating.bmp
res:2, type:0, name:RES_BITMAP_WATCHFACE_WEATHER_CLOUDY_DAY, file:cloudy_day.bmp
res:3, type:0, name:RES_BITMAP_WATCHFACE_WEATHER_CLOUDY_NIGHT, file:cloudy_night.bmp
res:4, type:0, name:RES_BITMAP_WATCHFACE_WEATHER_FOG, file:fog.bmp
res:5, type:0, name:RES_BITMAP_WATCHFACE_WEATHER_OVERCAST, file:overcast.bmp
res:6, type:0, name:RES_BITMAP_WATCHFACE_WEATHER_RAIN, file:rain.bmp
res:7, type:0, name:RES_BITMAP_WATCHFACE_WEATHER_SNOW, file:snow.bmp
res:8, type:0, name:RES_BITMAP_WATCHFACE_WEATHER_SUNNY_DAY, file:sunny_day.bmp
res:9, type:0, name:RES_BITMAP_WATCHFACE_WEATHER_SUNNY_NIGHT, file:sunny_night.bmp

-----------------begin create res.h-------------
-----------------create res.h ok-------------
-----------------begin create res_file-------------
type:0, res_key:5001, offset:171, res_size:2048, width:128, height:128
type:0, res_key:5002, offset:2219, res_size:1600, width:128, height:100
type:0, res_key:5003, offset:3819, res_size:600, width:80, height:60
type:0, res_key:5004, offset:4419, res_size:600, width:80, height:60
type:0, res_key:5005, offset:5019, res_size:600, width:80, height:60
type:0, res_key:5006, offset:5619, res_size:600, width:80, height:60
type:0, res_key:5007, offset:6219, res_size:600, width:80, height:60
type:0, res_key:5008, offset:6819, res_size:600, width:80, height:60
type:0, res_key:5009, offset:7419, res_size:600, width:80, height:60
type:0, res_key:5010, offset:8019, res_size:600, width:80, height:60
-------------create res_file ok---------------
---------------prepare pack head----------
---------------read res_file----------
---------------read code----------
not found file:.\build\maibu_code
create pack failed
正在编译...
arm-none-eabi-gcc -c -mthumb -mcpu=cortex-m0 new_weather_watchface.c -I .\SDK\
In file included from new_weather_watchface.c:7:0:
maibu_res.h:3:0: warning: "RES_BITMAP_WATCHFACE_WEATHER_BG" redefined [enabled by default]
In file included from .\SDK/maibu_sdk.h:120:0,
                 from new_weather_watchface.c:6:
.\SDK/maibu_res_bitmap_base_sdk.h:76:0: note: this is the location of the previous definition
new_weather_watchface.c: In function 'set_waiting_info_str':
new_weather_watchface.c:272:22: warning: initialization makes pointer from integer without a cast [enabled by default]
new_weather_watchface.c: In function 'weather_info_callback':
new_weather_watchface.c:390:22: warning: initialization makes pointer from integer without a cast [enabled by default]
new_weather_watchface.c: In function 'city_info_callback':
new_weather_watchface.c:505:22: warning: initialization makes pointer from integer without a cast [enabled by default]
new_weather_watchface.c: In function 'request_gps_info':
new_weather_watchface.c:594:2: error: too few arguments to function 'maibu_comm_request_phone'
In file included from .\SDK/maibu_sdk.h:126:0,
                 from new_weather_watchface.c:6:
.\SDK/maibu_ble.h:135:17: note: declared here
new_weather_watchface.c: In function 'time_change':
new_weather_watchface.c:611:23: warning: initialization makes pointer from integer without a cast [enabled by default]
new_weather_watchface.c: In function 'app_weather_update_timer_callback':
new_weather_watchface.c:831:23: warning: initialization makes pointer from integer without a cast [enabled by default]
new_weather_watchface.c: In function 'weather_comm_result_callback':
new_weather_watchface.c:873:4: error: too few arguments to function 'maibu_comm_request_phone'
In file included from .\SDK/maibu_sdk.h:126:0,
                 from new_weather_watchface.c:6:
.\SDK/maibu_ble.h:135:17: note: declared here
new_weather_watchface.c: In function 'main':
new_weather_watchface.c:903:2: warning: passing argument 1 of 'maibu_comm_register_phone_callback' from incompatible pointer type [enabled by default]
In file included from .\SDK/maibu_sdk.h:126:0,
                 from new_weather_watchface.c:6:
.\SDK/maibu_ble.h:121:13: note: expected 'CBCommPhone' but argument is of type 'void (*)(enum ERequestPhone,  void *)'
arm-none-eabi-ld: cannot find .\*.o: Invalid argument
readelf: Error: '.\build\maibu_code': No such file
正在打包...
-------------read appinfo.json-------------
uuid:39fe260221d9717da155d14404ca4054
app_id:33280
name:��������
icon:5001
version:127
watchface:0
sysapp:1
res_num:10
res:0, type:0, name:RES_BITMAP_WATCHFACE_WEATHER_BG, file:watchface-bg.bmp
res:1, type:0, name:RES_BITMAP_WATCHFACE_WEATHER_UPDATING, file:updating.bmp
res:2, type:0, name:RES_BITMAP_WATCHFACE_WEATHER_CLOUDY_DAY, file:cloudy_day.bmp
res:3, type:0, name:RES_BITMAP_WATCHFACE_WEATHER_CLOUDY_NIGHT, file:cloudy_night.bmp
res:4, type:0, name:RES_BITMAP_WATCHFACE_WEATHER_FOG, file:fog.bmp
res:5, type:0, name:RES_BITMAP_WATCHFACE_WEATHER_OVERCAST, file:overcast.bmp
res:6, type:0, name:RES_BITMAP_WATCHFACE_WEATHER_RAIN, file:rain.bmp
res:7, type:0, name:RES_BITMAP_WATCHFACE_WEATHER_SNOW, file:snow.bmp
res:8, type:0, name:RES_BITMAP_WATCHFACE_WEATHER_SUNNY_DAY, file:sunny_day.bmp
res:9, type:0, name:RES_BITMAP_WATCHFACE_WEATHER_SUNNY_NIGHT, file:sunny_night.bmp

-----------------begin create res.h-------------
-----------------create res.h ok-------------
-----------------begin create res_file-------------
type:0, res_key:5001, offset:171, res_size:2048, width:128, height:128
type:0, res_key:5002, offset:2219, res_size:1600, width:128, height:100
type:0, res_key:5003, offset:3819, res_size:600, width:80, height:60
type:0, res_key:5004, offset:4419, res_size:600, width:80, height:60
type:0, res_key:5005, offset:5019, res_size:600, width:80, height:60
type:0, res_key:5006, offset:5619, res_size:600, width:80, height:60
type:0, res_key:5007, offset:6219, res_size:600, width:80, height:60
type:0, res_key:5008, offset:6819, res_size:600, width:80, height:60
type:0, res_key:5009, offset:7419, res_size:600, width:80, height:60
type:0, res_key:5010, offset:8019, res_size:600, width:80, height:60
-------------create res_file ok---------------
---------------prepare pack head----------
---------------read res_file----------
---------------read code----------
not found file:.\build\maibu_code
create pack failed


正在编译...

E:\VisualMWatch_W32\new_weather_watchface.c: In function 'request_gps_info':
E:\VisualMWatch_W32\new_weather_watchface.c:594:2: error: too few arguments to function 'maibu_comm_request_phone'
  g_comm_id_gps = maibu_comm_request_phone(ERequestPhoneGPSAltitude, NULL);
  ^
In file included from e:\visualmwatch_w32\mbcc\include\maibu_sdk.h:23:0,
                 from E:\VisualMWatch_W32\new_weather_watchface.c:6:
e:\visualmwatch_w32\mbcc\include\os_comm.h:305:10: note: declared here
uint32_t maibu_comm_request_phone(enum ERequestPhone type,  uint8_t  *context, uint16_t context_size);
          ^
E:\VisualMWatch_W32\new_weather_watchface.c: In function 'weather_comm_result_callback':
E:\VisualMWatch_W32\new_weather_watchface.c:873:4: error: too few arguments to function 'maibu_comm_request_phone'
    g_comm_id_gps = maibu_comm_request_phone(ERequestPhoneGPSAltitude,  NULL);
    ^
In file included from e:\visualmwatch_w32\mbcc\include\maibu_sdk.h:23:0,
                 from E:\VisualMWatch_W32\new_weather_watchface.c:6:
e:\visualmwatch_w32\mbcc\include\os_comm.h:305:10: note: declared here
uint32_t maibu_comm_request_phone(enum ERequestPhone type,  uint8_t  *context, uint16_t context_size);
          ^
E:\VisualMWatch_W32\new_weather_watchface.c: In function 'main':
E:\VisualMWatch_W32\new_weather_watchface.c:903:2: warning: passing argument 1 of 'maibu_comm_register_phone_callback' from incompatible pointer type [enabled by default]
  maibu_comm_register_phone_callback(gps_info_callback);
  ^
In file included from e:\visualmwatch_w32\mbcc\include\maibu_sdk.h:23:0,
                 from E:\VisualMWatch_W32\new_weather_watchface.c:6:
e:\visualmwatch_w32\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);
      ^
'mbcc\bin\mw.exe' 不是内部或外部命令,也不是可运行的程序
或批处理文件。

作者: 王克_jRj95    时间: 2017-3-12 21:07
经过一番研究,发现不是环境配置的问题,是开源代码的问题,目前还没确定问题的具体位置,希望给为看到帖子的吧友相互交流,交流
作者: qs100371    时间: 2017-3-12 21:13
试试demo里的简单例子
作者: 王克_jRj95    时间: 2017-3-12 23:33
qs100371 发表于 2017-3-12 21:13
试试demo里的简单例子

demo的例子实验都是成功的
作者: 王克_jRj95    时间: 2017-3-12 23:34
错误研究进展:
与gps有关的错误,gps参数不足
new_weather_watchface.c:594:2: error: too few arguments to function 'maibu_comm_request_phone'
In file included from .\SDK/maibu_sdk.h:126:0,
                 from new_weather_watchface.c:6:
.\SDK/maibu_ble.h:135:17: note: declared here
new_weather_watchface.c: In function 'time_change':

于gps有关的错误,gps参数不足

E:\VisualMWatch_W64\new_weather_watchface.c:594:18: error: too few arguments to function 'maibu_comm_request_phone'
  g_comm_id_gps = maibu_comm_request_phone(ERequestPhoneGPSAltitude, NULL);
                  ^
In file included from .\mbcc\include/maibu_sdk.h:23:0,
                 from E:\VisualMWatch_W64\new_weather_watchface.c:6:
.\mbcc\include/os_comm.h:305:10: note: declared here
uint32_t maibu_comm_request_phone(enum ERequestPhone type,  uint8_t  *context, uint16_t context_size);
          ^
分析结果:
1.缺少gps参数
        readelf: Error: '.\build\maibu_code': No such file
2.找不到maibu_code 文件



实时天气:
Gps参数缺少:
watchface_weather.c:682:3: error: too few arguments to function 'maibu_comm_request_phone'
In file included from .\SDK/maibu_sdk.h:126:0,
                 from watchface_weather.c:50:
.\SDK/maibu_ble.h:135:17: note: declared here
watchface_weather.c: In function 'main':


watchface_weather.c:721:2: error: too few arguments to function 'maibu_comm_request_phone'
In file included from .\SDK/maibu_sdk.h:126:0,
                 from watchface_weather.c:50:
.\SDK/maibu_ble.h:135:17: note: declared here
arm-none-eabi-ld: cannot find .\*.o: Invalid argument



计数器:

找不到头文件os_res_bitmap.h
E:\VisualMWatch_W64\watchface_weather.c:36:27: fatal error: os_res_bitmap.h: No such file or directory
#include "os_res_bitmap.h"
                           ^
compilation terminated.


readelf: Error: '.\build\maibu_code': No such file



总结:
天气类软件
1.        获取gps的函数参数不足:估计是没有连接手机的原因,无法获取gps数据,需要自己给定。
2.        找不到maibu_code.  :目前不清楚原因
非天气类软件
1.找不到头文件:os_res_bitmap  :目前不清楚原因

作者: tda8361    时间: 2017-3-12 23:46
你这些都是自己写的吗
作者: 王克_jRj95    时间: 2017-3-13 00:04
tda8361 发表于 2017-3-12 23:46
你这些都是自己写的吗

代码是官网下载的,问题总结自己写的
作者: 细川玉木    时间: 2017-3-13 00:35
顶你
作者: qs100371    时间: 2017-3-13 05:47
上github下源码,不要用论坛上下的。地址在开发者板块。
作者: 王克_jRj95    时间: 2017-3-13 10:08
细川玉木 发表于 2017-3-13 00:35
顶你

谢谢吧友捧场
作者: 王克_jRj95    时间: 2017-3-13 10:08
qs100371 发表于 2017-3-13 05:47
上github下源码,不要用论坛上下的。地址在开发者板块。

好的,我去试试看
作者: niuniumm    时间: 2017-3-13 11:10
上github下源码,不要用论坛上下的
作者: 无齿的_kzWP4    时间: 2017-3-14 10:03





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