i can't see "SDL_ttf.h" in SDL3

So im working on a simple game and i want to make a button with text that appears on it. The only way i know how to make a text label is using SDL_ttf.h which i CAN’T find in SDL3. I tried downloading SDL_ttf.h but it just gives me a LOT of errors. I tried different solutions but to no avail.

SDL_ttf is a separate library that you need to install in addition to the core SDL library just like with SDL_image and SDL_mixer.

1 Like

What method are you using to install the SDL_ttf library?
When I build and install the libs from the github source they install into separate directories from SDL3, so my #include macros/directives look like this:

#include <SDL3/SDL.h>
#include <SDL3_image/SDL_image.h>
#include <SDL3_ttf/SDL_ttf.h>

int main()
{
    //etc.
}

If you are using a package manager or a OS-Store to install your libs, then make sure you are getting the SDL3 developer versions. I assume most OS-Stores will install for similar #include path requirements as shown, but that’s not a guarantee. You may have to check this for the specific OS you are using.

If none of the above helps, then please show the first couple of errors that your compiler/IDE is showing to you (or the whole list of errors if you can).

There’s a good chances you’re using the version for SDL2