Problem with a sdl-ttf-function (bug?)


I have a problem with a potential bug in the true-type-font-library of
sdl or maybe it is just a problem of my system-environments:

I compiled and tested a tutorial that displays a ttf-font in a
sdl-window on my development-machine (intel gentoo linux) and everything
works very nice. It compiles and the program shows the font.
[ tutorial-code / source-archive from here ]

BUT then I tried the same source (the same zip-archive with all the
resources) on two other gentoo-linux-systems (also both intel but other
Here it also compiles clean but if I start the program the sdl-window
only appears for a little moment, then closes and returns errorcode 1.
I tested the same thing also with suse-linux on one of the two
’test’-systems and then it works… (strange)
-> So I thought it could be a problem of library-versions:
On my development-machine (where everything is nice) I have these:

  • libsdl-1.2.8-r1
  • sdl-ttf-2.0.7
  • sdl-image-1.2.3-r1
    I tried to run the same versions on my test-machines, but no success
    (also tried newer/current versions).

I debugged into the code and found the following:

//Render the text
message = TTF_RenderText_Solid( font, “The quick brown fox jumps over
the lazy hound”, textColor );

//If there was an error in rendering the text
if( message == NULL )
//Here is the problem, but even TTF_GetError says nothing.
printf(“TTF-Error: %s\n”, TTF_GetError());
return 1;

The program now ends with printing “TTF-Error” but without giving a
reason :frowning:
So I think it is a problem with the TTF_RenderText_Solid-function but I
don’t know how I can fix it. I also tried to use different text,
ttf-files and different sizes as in the tutorial but nothing works.

I hope anyone can help me.
Thanks in advance!