Getting SDL_ttf to work with Cygwin

This is for Cygwin users only

If you see the error message,
/usr/local/lib/libfreetype.a(sfnt.o): In function `tt_face_build_cmaps':
/home/goldberg/freetype-2.3.11/src/sfnt/ttcmap.c:3450: undefined reference to `_
setjmp'
/usr/local/lib/libfreetype.a(smooth.o): In function `gray_convert_glyph_inner':
/home/goldberg/freetype-2.3.11/src/smooth/ftgrays.c:1721: undefined reference to
 `_setjmp'
Creating library file: .libs/libSDL_ttf.dll.a
collect2: ld returned 1 exit status
make: *** [libSDL_ttf.la] Error 1
then you need to edit the two files, ttcmap.c and ftgrays.c, that are causing the problem (by referencing "_setjmp" that is somehow not defined).

In your freetype-2.3.11 directory (where ever it was created when you installed FreeType), open the file src/sfnt/ttcmap.c and remove the following code at lines lines 3450-3455:
            if ( ft_setjmp(
              *((ft_jmp_buf*)&FT_VALIDATOR( &valid )->jump_buffer) ) == 0 )
            {
              /* validate this cmap sub-table */
              error = clazz->validate( cmap, FT_VALIDATOR( &valid ) );
            }
Do not try commenting these lines out using "//", that won't work. It's best to just delete the lines.

Then, again starting from your freetype-2.3.11 directory, open the file src/smooth/ftgrays.c and remove the following code at lines 1721-1727:
    if ( ft_setjmp( ras.jump_buffer ) == 0 )
    {
      error = FT_Outline_Decompose( &ras.outline, &func_interface, &ras );
      gray_record_cell( RAS_VAR );
    }
    else
      error = ErrRaster_Memory_Overflow;
Do not try commenting these lines out using "//", that won't work. It's best to just delete the lines.

Then, go back to your freetype-2.3.11 directory and run "make" and "make install" again to recompile and re-install freetype.

Then, come back to your SDL_tff directory and run "make" again.

Resume following the instructions for installing SDL_ttf on the previous page.