- UID
 - 2024
 
- 麦力
 - 55 
 
- 注册时间
 - 2016-12-7
 
- 最后登录
 - 2016-12-13
 
 
 
 
 
  
- 精华
 - 0
 
- 阅读权限
 - 10
 
- 在线时间
 - 1 小时
 
 
 
 
 | 
 
 本帖最后由 zt-x 于 2016-12-7 11:27 编辑  
 
最近在编写一个简单的程序,然后遇到了一个奇怪的问题:在模拟器上可以跑通过,但是放在手表上就会出先重启的问题 
- /*
 
 -  * =====================================================================================
 
 -  *     本程序根据 gliu (), gliu@maibu.cc 的 demo_text.c 修改而来特别感谢
 
 -  *     Modulename:
 
 -  *       Filename:  PoetryTang.c
 
 -  *
 
 -  *    Description:  
 
 -  *    Corporation:
 
 -  * 
 
 -  *         Author:  Zoologist 
 
 -  *        Created:  2016年12月1日
 
 -  *
 
 -  * =====================================================================================
 
 -  *
 
 -  * =====================================================================================
 
 -  * 
 
 -  *   MODIFICATION HISTORY :
 
 -  *    
 
 -  *                     DATE :  
 
 -  *                     DESC :
 
 -  * =====================================================================================
 
 -  */        
 
 - #include <stdlib.h>
 
 - #include <stdio.h>
 
 - #include <string.h>
 
  
- #include "maibu_sdk.h"
 
 - #include "maibu_res.h"
 
  
 
- //窗口显示的内容
 
  
 
-         
 
 - P_Window p_window;
 
  
- void setup()
 
 - {
 
 -   //创建窗口
 
 -   p_window  = app_window_create();
 
 -         if (NULL == p_window)
 
 -         {
 
 -                 return ;
 
 -         }
 
  
-         /*创建文本图层框架范围*/
 
 -         GRect frame = {{0, 45}, {40, 128}};
 
 -         unsigned char buf[]=        "麦步欢迎您!";
 
  
-         /*生成文本结构体, 依次为文本内容、文本显示框架、对齐方式、字体字号*/
 
 -         LayerText text = {buf, frame, GAlignCenter, U_GBK_SIMSUNBD_16};
 
  
-         /*创建文本图层*/
 
 -         P_Layer layer = app_layer_create_text(&text);
 
  
-         /*添加文本图层到窗口中*/
 
 -         app_window_add_layer(p_window, layer);
 
  
-         app_window_stack_push(p_window);
 
  
- return ;
 
 - }
 
 -   
 
 -   
 
 - int main()
 
 - {
 
 -   
 
 - //simulator_init();
 
 -         setup();
 
 -         //while (1==1)
 
 -         //{
 
 -         //        loop(); 
 
 -         //}
 
 -         
 
 - //simulator_wait();
 
 -  
 
 -         return 0;
 
  
- }
 
  复制代码 
最后发现,出现问题的代码在 
P_Window p_window; 这里 
如果写成下面这个样子就没问题 
 
void setup(){   
//创建窗口   
P_Window  p_window  = app_window_create(); 
 
我想问一下这个是不是编译器的问题? 
谢谢! 
 
 
 |   
 
 
 
 |