標(biāo)題: 求助,STM32編譯過程中出現(xiàn)這種情況如何解決Error: L6218E和error: L6235E [打印本頁]

作者: qq1451740662    時間: 2021-3-8 14:02
標(biāo)題: 求助,STM32編譯過程中出現(xiàn)這種情況如何解決Error: L6218E和error: L6235E
把帶的所有啟動文件敷上之后編譯出現(xiàn)error: L6235E: More than one section matches selector - cannot all be FIRST/LAST.按照網(wǎng)上教程只留一個啟動文件時,出現(xiàn)17個相同錯誤Error: L6218E,具體報錯內(nèi)容如下:
.\CE.axf: Error: L6218E: Undefined symbol Init_AD9959 (referred from main.o).
.\CE.axf: Error: L6218E: Undefined symbol KEY_EXIT (referred from main.o).
.\CE.axf: Error: L6218E: Undefined symbol KeyRead (referred from main.o).
.\CE.axf: Error: L6218E: Undefined symbol Keycode (referred from main.o).
.\CE.axf: Error: L6218E: Undefined symbol LCD_Refresh_Gram (referred from main.o).
.\CE.axf: Error: L6218E: Undefined symbol LED_Init (referred from main.o).
.\CE.axf: Error: L6218E: Undefined symbol MY_NVIC_PriorityGroup_Config (referred from main.o).
.\CE.axf: Error: L6218E: Undefined symbol Set_PointFre (referred from main.o).
.\CE.axf: Error: L6218E: Undefined symbol Timerx_Init (referred from main.o).
.\CE.axf: Error: L6218E: Undefined symbol _return (referred from main.o).
.\CE.axf: Error: L6218E: Undefined symbol delay_init (referred from main.o).
.\CE.axf: Error: L6218E: Undefined symbol delay_ms (referred from main.o).
.\CE.axf: Error: L6218E: Undefined symbol initial_lcd (referred from main.o).
.\CE.axf: Error: L6218E: Undefined symbol key_init (referred from main.o).
.\CE.axf: Error: L6218E: Undefined symbol KEY_Cont (referred from stm32f10x_it.o).
.\CE.axf: Error: L6218E: Undefined symbol KEY_Sys_Timer (referred from stm32f10x_it.o).
.\CE.axf: Error: L6218E: Undefined symbol KEY_Time (referred from stm32f10x_it.o).
Not enough information to list image symbols.
Not enough information to list load addresses in the image map.
Finished: 2 information, 0 warning and 17 error messages.
按照帖子里說的找到未定義的字符,然后右擊查看定義后顯示為(這里查看的是Key_init以此為例)
source browser:'Key_init'undefined Definition/Reference,請問各位大佬有沒有解決方法


作者: lovezjf234    時間: 2021-3-8 15:35
函數(shù)或者變量沒定義,你定義下就行了,函數(shù)沒定義,先寫一個空函數(shù),編譯先能通過,在寫函數(shù)內(nèi)容進(jìn)去
作者: 黃youhui    時間: 2021-3-8 15:45
lovezjf234 發(fā)表于 2021-3-8 15:35
函數(shù)或者變量沒定義,你定義下就行了,函數(shù)沒定義,先寫一個空函數(shù),編譯先能通過,在寫函數(shù)內(nèi)容進(jìn)去

某個h文件沒加或者參數(shù)沒弄好
作者: qq1451740662    時間: 2021-3-8 15:45
lovezjf234 發(fā)表于 2021-3-8 15:35
函數(shù)或者變量沒定義,你定義下就行了,函數(shù)沒定義,先寫一個空函數(shù),編譯先能通過,在寫函數(shù)內(nèi)容進(jìn)去

main函數(shù)中已經(jīng)定義了的
32新手小白,好多不懂的求指教謝謝
作者: qq1451740662    時間: 2021-3-8 15:48
本帖最后由 qq1451740662 于 2021-3-8 15:51 編輯
黃youhui 發(fā)表于 2021-3-8 15:45
某個h文件沒加或者參數(shù)沒弄好

相對應(yīng)的.h文件都是已經(jīng)添加了的,就是看到網(wǎng)上有帖子說沒加就加上后編譯出現(xiàn)了新的報錯,錯誤代碼倒是相同..\HARDWARE\LCD\lcd.c(352): warning:  #167-D: argument of type "const char *" is incompatible with parameter of type "const u8 *"
                                  WriteA_Chinese(mode,x,y,p);
..\HARDWARE\LCD\lcd.c(385): warning:  #167-D: argument of type "u8 *" is incompatible with parameter of type "const char *"
          LCD_ShowAllString(1,x0,y0*8,pp);
..\HARDWARE\LCD\lcd.c(389): warning:  #167-D: argument of type "u8 *" is incompatible with parameter of type "const char *"
          LCD_ShowAllString(show_mode,x0,y0*8,pp);
..\HARDWARE\LCD\lcd.c: 3 warnings, 0 errors
compiling led.c...
compiling Setting.c...
..\HARDWARE\SETMODE\Setting.c(12): warning:  #167-D: argument of type "uint8_t *" is incompatible with parameter of type "char *__restrict__"
          strcpy(value[0].Num_Temp, "0000000000");
..\HARDWARE\SETMODE\Setting.c(13): warning:  #167-D: argument of type "uint8_t *" is incompatible with parameter of type "char *__restrict__"
          strcpy(value[1].Num_Temp, "0000000000");
..\HARDWARE\SETMODE\Setting.c(14): warning:  #167-D: argument of type "uint8_t *" is incompatible with parameter of type "char *__restrict__"
          strcpy(value[2].Num_Temp, "0000000000");
..\HARDWARE\SETMODE\Setting.c(15): warning:  #167-D: argument of type "uint8_t *" is incompatible with parameter of type "char *__restrict__"
          strcpy(value[3].Num_Temp, "0000000000");
..\HARDWARE\SETMODE\Setting.c(16): warning:  #167-D: argument of type "uint8_t *" is incompatible with parameter of type "char *__restrict__"
          strcpy(value[0].name, "CH0:");
..\HARDWARE\SETMODE\Setting.c(17): warning:  #167-D: argument of type "uint8_t *" is incompatible with parameter of type "char *__restrict__"
          strcpy(value[1].name, "CH1:");
..\HARDWARE\SETMODE\Setting.c(18): warning:  #167-D: argument of type "uint8_t *" is incompatible with parameter of type "char *__restrict__"
          strcpy(value[2].name, "CH2:");
..\HARDWARE\SETMODE\Setting.c(19): warning:  #167-D: argument of type "uint8_t *" is incompatible with parameter of type "char *__restrict__"
          strcpy(value[3].name, "CH3:");
..\HARDWARE\SETMODE\Setting.c(37): warning:  #167-D: argument of type "uint8_t *" is incompatible with parameter of type "char *__restrict__"
          strcpy(value[
ine_max - 1].name, "   Back  ");
..\HARDWARE\SETMODE\Setting.c(46): warning:  #167-D: argument of type "u8 *" is incompatible with parameter of type "char *__restrict__"
                  strcpy(SELECT_L, "1111");
..\HARDWARE\SETMODE\Setting.c(47): warning:  #167-D: argument of type "u8 *" is incompatible with parameter of type "char *__restrict__"
                  strcpy(SELECT_S, "1111111111");
..\HARDWARE\SETMODE\Setting.c(79): warning:  #167-D: argument of type "u8 *" is incompatible with parameter of type "char *__restrict__"
                                          strcpy(SELECT_L, "1111");
..\HARDWARE\SETMODE\Setting.c(99): warning:  #167-D: argument of type "u8 *" is incompatible with parameter of type "char *__restrict__"
                                  strcpy(SELECT_L, "1111");
..\HARDWARE\SETMODE\Setting.c(44): warning:  #177-D: variable "Set_Key" was declared but never referenced
                  u8 Set_Key, line = 1, OK = 0, SELECT_L[4], SELECT_S[10];
..\HARDWARE\SETMODE\Setting.c(44): warning:  #177-D: variable "OK" was declared but never referenced
                  u8 Set_Key, line = 1, OK = 0, SELECT_L[4], SELECT_S[10];
..\HARDWARE\SETMODE\Setting.c: 15 warnings, 0 errors
compiling timer.c...
linking...
.\CE.axf: Error: L6218E: Undefined symbol MY_NVIC_PriorityGroup_Config (referred from main.o).
.\CE.axf: Error: L6218E: Undefined symbol Set_PointFre (referred from main.o).
.\CE.axf: Error: L6218E: Undefined symbol _return (referred from main.o).
.\CE.axf: Error: L6218E: Undefined symbol delay_init (referred from main.o).
.\CE.axf: Error: L6218E: Undefined symbol delay_ms (referred from main.o).
.\CE.axf: Error: L6218E: Undefined symbol SinAmp (referred from ad9959.o).
.\CE.axf: Error: L6218E: Undefined symbol SinFre (referred from ad9959.o).
.\CE.axf: Error: L6218E: Undefined symbol SinPhr (referred from ad9959.o).
.\CE.axf: Error: L6218E: Undefined symbol draw_circle_8 (referred from lcd.o).
.\CE.axf: Error: L6218E: Undefined symbol swap_int (referred from lcd.o).
.\CE.axf: Error: L6218E: Undefined symbol SweepFlag (referred from timer.o).
.\CE.axf: Error: L6218E: Undefined symbol SweepMaxFre (referred from timer.o).
.\CE.axf: Error: L6218E: Undefined symbol SweepMinFre (referred from timer.o).
.\CE.axf: Error: L6218E: Undefined symbol SweepStepFre (referred from timer.o).
.\CE.axf: Error: L6218E: Undefined symbol SweepTime (referred from timer.o).
Not enough information to list image symbols.
Not enough information to list load addresses in the image map.
Finished: 2 information, 0 warning and 15 error messages.
".\CE.axf" - 15 Error(s), 18 Warning(s).

報錯和警告更多了,請問這是什么原因

1.png (6.29 KB, 下載次數(shù): 184)

1.png

作者: 黃youhui    時間: 2021-3-9 08:29
qq1451740662 發(fā)表于 2021-3-8 15:48
相對應(yīng)的.h文件都是已經(jīng)添加了的,就是看到網(wǎng)上有帖子說沒加就加上后編譯出現(xiàn)了新的報錯,錯誤代碼倒是相 ...

是IAR嗎?是的話你自己想辦法,這東西一代版本一代神,代代版本不兼容。
如果是keil的話,你的文件有點問題,所有的用戶代碼都不包含stm32的庫文件,你看看這是編譯成功的。

你是不是每個h文件里面都沒有
#include "stm32f4xx.h"//不一定是STM32F4,你用哪個加哪個

51hei截圖20210309082338.png (10.48 KB, 下載次數(shù): 184)

51hei截圖20210309082338.png





歡迎光臨 (http://www.torrancerestoration.com/bbs/) Powered by Discuz! X3.1