我正在尝试使用 ARM stm32f10x 进行编译,但出现了这个错误
**Rebuild target 'Final_STM_Thermal'
assembling startup_stm32f10x_hd.s...
compiling main.c...
..\User\defs.h(15): warning: #1295-D: Deprecated declaration ADC_GetValue - give arg types
compiling stm32f10x_it.c...
compiling GPIO_Config.c...
..\User\defs.h(15): warning: #1295-D: Deprecated declaration ADC_GetValue - give arg types
compiling Printer.c...
..\User\defs.h(15): warning: #1295-D: Deprecated declaration ADC_GetValue - give arg types
..\User\Printer.c(472): warning: #177-D: variable "length" was declared but never referenced
..\User\Printer.c(472): warning: #177-D: variable "x" was declared but never referenced
..\User\Printer.c(473): warning: #177-D: variable "maxsize" was declared but never referenced
compiling render_bmp.c...
..\User\mf_font.h(135): warning: #1295-D: Deprecated declaration mf_get_font_list - give arg types
..\User\mf_kerning.h(27): warning: #1-D: last line of file ends without a newline
..\User\render_bmp.c(98): warning: #9-D: nested comment is not allowed
..\User\render_bmp.c(48): warning: #177-D: variable "usage_text" was declared but never referenced
..\User\render_bmp.c(59): warning: #177-D: function "parse_options" was declared but never referenced
..\User\render_bmp.c(222): warning: #177-D: function "character_callback" was declared but never referenced
compiling mf_encoding.c...
compiling mf_font.c...
..\User\mf_font.h(135): warning: #1295-D: Deprecated declaration mf_get_font_list - give arg types
compiling mf_rlefont.c...
..\User\mf_font.h(135): warning: #1295-D: Deprecated declaration mf_get_font_list - give arg types
compiling core_cm3.c...
compiling system_stm32f10x.c...
compiling misc.c...
compiling stm32f10x_gpio.c...
compiling stm32f10x_rcc.c...
compiling stm32f10x_usart.c...
compiling stm32f10x_adc.c...
linking...
**.\Obj\stm32_gpio_demo.axf: Error: L6218E: Undefined symbol mf_scale_font (referred from render_bmp.o).**
**.\Obj\stm32_gpio_demo.axf: Error: L6218E: Undefined symbol mf_wordwrap (referred from render_bmp.o).**
Target not created**
答案1
我假设 mf_scale_font 和 mf_wordwrap 是 uGFX 库的一部分,并且这些文件在您的设置中缺少。
你确定已经安装了依赖项吗?
sudo apt-get install libsdl2-dev:i386 build-essential gcc-multilib
根据官方文件Linux uGFX 维基
您还需要设置:CFLAGS = sdl2-config --libs --cflags
以使 SDL 正确链接。