problem compiling sdl_ttf

I am trying to compile SDL_ttf for Windows with CMake using the method shown on the install page[0]. I ran the script as shown to clone freetype and other dependencies. At first CMake reported an error that it couldn’t find freetype, so I set the variables FREETYPE_LIBRARY and FREETYPE_INCLUDE_DIRS that weren’t set because it was in a non-standard location, pointing them to the external path to freetype in the sdl_ttf repo. It appeared to build but ends with a fatal error (lnk1104) saying it cannot open file “src.obj” in the external/freetype folder.

I can build both SDL3 and SDL_image with CMake using the same methods, it’s just SDL_ttf that isn’t working. I tried searching the SDL_ttf repo itself but couldn’t find anything. Thanks for your time.

[0]SDL_ttf/docs/INTRO-cmake.md at main · libsdl-org/SDL_ttf · GitHub

I have written all steps when I built SDL_ttf 3.1.0 with CMake and VS 2022. I hope it will help you:

1 Like

Hi krapp,

on windows use:

-DSDLIMAGE_AVIF=OFF

or set in your root CMakeLists.txt

set(SDLIMAGE_AVIF OFF CACHE BOOL "" FORCE)

it should be fine

Domenico

1 Like