raylib
raylib copied to clipboard
[rcore] Building with SDL fails without rtext
The rtext module is supposed to be optional. However, when building a program for the desktop platform using the SDL backend, it fails with the following message due to rcore_desktop_sdl.c requiring the GetCodepointNext() function:
/usr/bin/ld: ../src/libraylib.a(rcore.o): in function `PollInputEvents':
rcore.c:(.text+0x2d212): undefined reference to `GetCodepointNext'
collect2: error: ld returned 1 exit status
It fails when building a program, but not when building raylib itself as a static library.
Steps to reproduce
- Edit
config.hdo disable thertextmodule, like so://#define SUPPORT_MODULE_RTEXT 1 - Build raylib like so:
make PLATFORM=PLATFORM_DESKTOP_SDL SDL_INCLUDE_PATH=/usr/include/SDL2/ SDL_LIBRARY_PATH=/usr/lib - Finally, build a program using raylib:
gcc test.c -lraylib -lSDL2
@M374LX Good catch! It should be reviewed!
Would it make sense to pull out the unicode related functions out of the text module and put them in a separate module (maybe inside util), since it is useful outside just text rendering?
by unicode related function I specifically mean the 3 functions GetCodepoint, GetCodepointNext, GetCodepointPrevious. Since they are not dependent on any other part of the rtext module could we enable those functions even if the rtext module is disabled?