常见错误分析及解决方法

时间:2023-01-18 19:39:08
Such as :
compile block ----Con_app
Error:make[1]: *** No rule to make target `Hai_Extern.obj', needed by `build/GXQ26_07B/gprs/MT6226o/lib/conn_app.lib'.  Stop.
Reason:
1.在make文件中添加了 Hai_Extern.c文件的编译,但在对应的文件目录下找不到对应的.c文件。
2.在make文件中没添加生成Hai_Extern.obj目标文件的源文件.c或.h.
 
Compile block ----mmi_app
Error:
"plutommi/mmi/ebookreader/ebookinc/EbookProt.h", line 29: Error: C2456E: undeclared name, inventing 'extern int GUI_SHARED_BYTES'
"plutommi/mmi/ebookreader/ebookinc/EbookProt.h", line 29: Serious error: C2958E: illegal in constant expression_r_r_r: non constant 'GUI_SHARED_BYTES':
Solve mothed:查找GUI_SHARED_BYTES 是否有定义,没有定义则需要添加定义,以及定义为constant是否正确。
 
     Compile block ----mmi_framework
     Error:
     "plutommi/mmi/ebookreader/ebookinc/EbookProt.h", line 173: Warning: C2816W: Unbalanced #if/#ifdef/#ifndef/#endif in file
     Solve mothed: check Number of #endif and #if
 
     Compile block--- custom
Error:
"custom/system/GXQ26_07B_BB/custom_sap.h", line 68: Serious error: C2933E: type disagreement for 'MSG_ID_CUSTOM1_CUSTOM2'
"custom/system/GXQ26_07B_BB/custom_sap.h", line 68: Serious error: C2934E: duplicate definition of 'MSG_ID_CUSTOM1_CUSTOM2'
"custom/system/GXQ26_07B_BB/custom_sap.h", line 69: Serious error: C2933E: type disagreement for 'MSG_ID_CUSTOM2_CUSTOM1'
"custom/system/GXQ26_07B_BB/custom_sap.h", line 69: Error: C2991E: linkage disagreement for 'MSG_ID_CUSTOM2_CUSTOM1' - treated as 'extern'
"custom/system/GXQ26_07B_BB/custom_sap.h", line 71: Serious error: C2933E: type disagreement for 'MSG_ID_TTSPLAYER_SERVICEOPEN'
"custom/system/GXQ26_07B_BB/custom_sap.h", line 71: Error: C2991E: linkage disagreement for 'MSG_ID_TTSPLAYER_SERVICEOPEN' - treated as 'extern'
Solve mothed: 检查编译文件是否重复包含custom_sap.h文件
 
Error:
在生成database BPLGU文件出错原因 可能是因为缺少 以下三个文件:造成。
BPLGUInfoCustomApp_MT6226_S01_MAUI_07B_W08_16_MP_V2
BPLGUInfoCustomApp_MT6226M_S01_MAUI_07B_W08_16_MP_V2
BPLGUInfoCustomApp_MT6227_S01_MAUI_07B_W08_16_MP_V2
还有其他原因造成,则需要查build/log下log文件根据提示的错误信息来更改工程文件。
  
 
Error:
编译某个文件时提示 can not open XXX.h文件
Solve mothed:
1.      在make 文件中修改对应的XXXinc文件,添加对.h文件的编译
2.      在.h文件中包含的字符、变量、函数等,用extern 对其进行定义。
 

Error: L6218E: Undefined symbol Image$$ZI$$Limit (referred from sys_stackheap.o).
Not enough information to produce a SYMDEFs file.
Finished: 1 information, 36 warning and 1 error messages.

错误原因:
          这个问题我们之前是有遇到过的,我记得是以为nativeInterface.c文件中以下三个函数写为空函数,即可编译通过。
          void printfString(const char* message,const nano_u2* buffer,nano_s4 iLength)
           void printfByteArray(const char* message,const nano_u1* buffer,nano_s4 iLength)
           void printfShortArray(const char* message,const nano_u2* buffer,nano_s4 iLength)
     这个问题是由于代码或者Lib中调用了 C Lib的malloc或者类似于strdup,printf 这样的会调用malloc的C Lib function 引起的。MTK Platform不支持 C lib的malloc,而用 Ctrl Buffer机制代替了malloc,以便于调试memory leak问题。

 

ERROR:
"LCMMI/MMI/FUNCTIONCONTROL/INC/FunctionControl.h", line 22: Serious error: C2933E: type disagreement for 'NANO_NORMAL_STATE'
"LCMMI/MMI/FUNCTIONCONTROL/INC/FunctionControl.h", line 22: Serious error: C2934E: duplicate definition of 'NANO_NORMAL_STATE'
"LCMMI/MMI/FUNCTIONCONTROL/INC/FunctionControl.h", line 23: Serious error: C2933E: type disagreement for 'NANO_NEW_MSG_STATE'
"LCMMI/MMI/FUNCTIONCONTROL/INC/FunctionControl.h", line 23: Serious error: C2934E: duplicate definition of 'NANO_NEW_MSG_STATE'
"LCMMI/MMI/FUNCTIONCONTROL/INC/FunctionControl.h", line 24: Serious error: C2933E: type disagreement for 'NANO_GET_MSG_STATE'
"LCMMI/MMI/FUNCTIONCONTROL/INC/FunctionControl.h", line 24: Serious error: C2934E: duplicate definition of 'NANO_GET_MSG_STATE'
"LCMMI/MMI/FUNCTIONCONTROL/INC/FunctionControl.h", line 26: Serious error: C2933E: type disagreement for 'NANO_DEL_MSG_STATE'
"LCMMI/MMI/FUNCTIONCONTROL/INC/FunctionControl.h", line 26: Serious error: C2934E: duplicate definition of 'NANO_DEL_MSG_STATE'
"LCMMI/MMI/FUNCTIONCONTROL/INC/FunctionControl.h", line 26: Serious error: C2933E: type disagreement for 'NANO_MSG_STATE'


 错误原因:重复包含 FunctionControl.h 文件,导致在.h文件中定义的struct 在其他文件调用时一直出错。注意:.h文件一定不能重复包含,否则编译通不过。

 

1564519681:

2009-08-03 14:24:56

ERROR:
Compiling plutommi/mmi/miscframework/miscframeworksrc/pwroncharger.c ...
"custom/drv/LCD/GXQ23_08B_LCM/lcd_sw_inc.h", line 105: Warning: C2220W: Superfluous ',' in 'enum' declaration
"plutommi/mmi/GPS/GPSInc/GPS.h", line 291: Warning: C2220W: Superfluous ',' in 'enum' declaration
"plutommi/mmi/miscframework/miscframeworksrc/pwroncharger.c", line 993: Warning: C2207W: inventing 'extern int GPIO_WriteIO();'
"plutommi/mmi/miscframework/miscframeworksrc/pwroncharger.c", line 1010: Warning: C2207W: inventing 'extern int pmu_set_gled();'
"plutommi/mmi/miscframework/miscframeworksrc/pwroncharger.c", line 1318: Warning: C2870W: variable 'Error' declared but not used
"plutommi/mmi/miscframework/miscframeworksrc/pwroncharger.c", line 1604: Error: C2933E: type disagreement for 'CHECK_MO_ALLOW'
"plutommi/mmi/miscframework/miscframeworksrc/pwroncharger.c", line 1635: Error: C2933E: type disagreement for 'IS_LOW_BATTERY'
"plutommi/mmi/miscframework/miscframeworksrc/pwroncharger.c", line 2032: Warning: C2207W: inventing 'extern int gps_pwdown_contol();'
plutommi/mmi/miscframework/miscframeworksrc/pwroncharger.c: 6 warnings, 2 errors, 0 serious errors
错误原因:
在 FunctionControl.h中定义的  #define BOOL char
和系统中其他文件定义的 #define BOOL unsigned  char 不一致导致