Project added code does not build - undefined reference to

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Project added code does not build - undefined reference to

ソリューションへジャンプ
1,190件の閲覧回数
Badman
Contributor I

I am using MCUXpresso IDE v11.5.1 [Build 7266] [2022-04-13].

I added icludes path to "${workspace_loc:/${ProjName}/hd44780}"

Include paths.png

I added source location to "WYS_HD44780\hd44780"

Source Location.png

However, when building, I have a message undefined reference to... What am I doing wrong ?

 

 

Building target: WYS_HD44780.axf
Invoking: MCU Linker
arm-none-eabi-gcc -nostdlib -L"/home/badman/Programowanie/LPC1114_MCU/CMSIS_CORE_LPC11xx/Debug" -Xlinker -Map="WYS_HD44780.map" -Xlinker --cref -Xlinker --gc-sections -Xlinker -print-memory-usage -mcpu=cortex-m0 -mthumb -T "WYS_HD44780_Debug.ld" -o "WYS_HD44780.axf"  ./src/WYS_HD44780.o ./src/cr_startup_lpc11xx.o ./src/crp.o ./src/delay.o   -lCMSIS_CORE_LPC11xx
/usr/local/mcuxpressoide-11.5.1_7266/ide/plugins/com.nxp.mcuxpresso.tools.linux_11.5.1.202201181444/tools/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld: ./src/WYS_HD44780.o: in function `main':
Memory region         Used Size  Region Size  %age Used
        MFlash32:         672 B        32 KB      2.05%
         RamLoc8:          0 GB         8 KB      0.00%
/home/badman/Programowanie/LPC1114_MCU/WYS_HD44780/Debug/../src/WYS_HD44780.c:20: undefined reference to `lcd_init'
/usr/local/mcuxpressoide-11.5.1_7266/ide/plugins/com.nxp.mcuxpresso.tools.linux_11.5.1.202201181444/tools/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld: /home/badman/Programowanie/LPC1114_MCU/WYS_HD44780/Debug/../src/WYS_HD44780.c:21: undefined reference to `lcd_str'
collect2: error: ld returned 1 exit status
make[1]: *** [makefile:47: WYS_HD44780.axf] Błąd 1
make: *** [makefile:38: all] Błąd 2
"make -r -j3 all" terminated with exit code 2. Build might be incomplete.

 

 

0 件の賞賛
返信
1 解決策
1,181件の閲覧回数
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi 

Your first screenshot doesn't include "src" path. please add it.

Besides, I suggest you importing a lpcopen demo code, refer the demo code path settings to set your project path.

If the problem persists, please upload your project here, thus we can check it directly.

Thanks,

Jun Zhang

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
1,182件の閲覧回数
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi 

Your first screenshot doesn't include "src" path. please add it.

Besides, I suggest you importing a lpcopen demo code, refer the demo code path settings to set your project path.

If the problem persists, please upload your project here, thus we can check it directly.

Thanks,

Jun Zhang

0 件の賞賛
返信
1,172件の閲覧回数
Badman
Contributor I

I checked all the settings, it turned out that I deleted the file hd44780.c from the added folder hd44780.

The function prototypes were in the file hd44780.h and the functions were missing hence the undefined reference message.

 

0 件の賞賛
返信