Jump to content

Linking error on using fonts


LeMoussel

Recommended Posts

In gfxconf.h, I enable the following settings:

#define GDISP_NEED_TEXT TRUE

#define GDISP_NEED_UTF8 TRUE

#define GDISP_INCLUDE_FONT_DEJAVUSANS16 TRUE

when linking, I got this error

[cc] Starting link

[cc] arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -g -nostartfiles -Wl,-Map=Test_uGFX.map -O0 -Wl,--gc-sections -LD:\Applications\CooCox\CoIDE\configuration\ProgramData\Test_uGFX -Wl,-TD:\Applications\CooCox\CoIDE\configuration\ProgramData\Test_uGFX/arm-gcc-link.ld -g -o Test_uGFX.elf ..\obj\DejaVuSans32.o ..\obj\stm32f10x_rtc.o ..\obj\fixed_10x20.o ..\obj\stm32f10x_tim.o ..\obj\LargeNumbers.o ..\obj\DejaVuSansBold12_aa.o ..\obj\mf_scaledfont.o ..\obj\stm32f10x_dbgmcu.o ..\obj\system_stm32f10x.o ..\obj\gdisp_lld_ILI9325.o ..\obj\image_bmp.o ..\obj\stm32f10x_fsmc.o ..\obj\stm32f10x_pwr.o ..\obj\startup_stm32f10x_md.o ..\obj\win32.o ..\obj\stm32f10x_can.o ..\obj\chibios.o ..\obj\stm32f10x_gpio.o ..\obj\stm32f10x_dac.o ..\obj\image_jpg.o ..\obj\UI1.o ..\obj\osx.o ..\obj\main.o ..\obj\DejaVuSans16_aa.o ..\obj\image_native.o ..\obj\fixed_5x8.o ..\obj\UI2.o ..\obj\image_gif.o ..\obj\stm32f10x_crc.o ..\obj\mf_font.o ..\obj\DejaVuSansBold12.o ..\obj\mf_rlefont.o ..\obj\mf_bwfont.o ..\obj\stm32f10x_rcc.o ..\obj\freertos.o ..\obj\fixed_7x14.o ..\obj\stm32f10x_exti.o ..\obj\DejaVuSans10.o ..\obj\stm32f10x_adc.o ..\obj\fonts.o ..\obj\mf_encoding.o ..\obj\stm32f10x_usart.o ..\obj\DejaVuSans12.o ..\obj\DejaVuSans32_aa.o ..\obj\syscalls.o ..\obj\stm32f10x_flash.o ..\obj\mf_justify.o ..\obj\stm32f10x_cec.o ..\obj\linux.o ..\obj\stm32f10x_sdio.o ..\obj\DejaVuSans16.o ..\obj\stm32f10x_dma.o ..\obj\gdisp.o ..\obj\image_png.o ..\obj\gfx.o ..\obj\misc.o ..\obj\DejaVuSans24.o ..\obj\stm32f10x_wwdg.o ..\obj\stm32f10x_spi.o ..\obj\mf_wordwrap.o ..\obj\raw32.o ..\obj\stm32f10x_i2c.o ..\obj\image.o ..\obj\DejaVuSans12_aa.o ..\obj\stm32f10x_bkp.o ..\obj\DejaVuSans24_aa.o ..\obj\mf_kerning.o ..\obj\stm32f10x_iwdg.o -lm -lgcc -lc

[cc] ..\obj\DejaVuSans16.o:(.rodata+0x728): multiple definition of `mf_rlefont_DejaVuSans16'

[cc] ..\obj\mf_font.o:(.rodata+0x728): first defined here

[cc] collect2.exe: error: ld returned 1 exit status

thanks for your help

Link to comment
Share on other sites

  • 5 weeks later...

There are a few reasons that the font files are currently in c files rather than h files...

  • Historically it has just always been done this way
  • The font generator generates a c file and to alter this would require changing old and fragile code (I am not sure we can even still compile the mcufont font generator utility)

None of these are really good reasons, it however just takes time to change these things and the effort involved has been very low priority considering the other work that we want to get done.

Note: this is not the only place in uGFX that c files get included into other sources rather than being compiled directly. Other places this happens include where we are incorporating third party code into uGFX such as FATFS. Doing it this way allows us to leave the original code unchanged and "patch" necessary changes into it using macro definitions from the file including the source. Unfortunately, other than directly modifying the third party code (which may create license issues) this is the only way this can be done.

Although using the IDE to directly "build" the project is possible - it is not our supported configuration. Our supported configuration is using a "custom makefile" project.

This avoids all of these sorts of dramas. Source files can then be included into the IDE without them affecting the build process. As proof of this, more than 30% of my development of the uGFX library itself is done using Em:Blocks (the other 70% is using the Eclipse IDE or the command line).

The original source of this thread related to an IDE that supposedly could not do custom makefile builds. That particular situation is still being investigated.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...