SDL_ttf linking error using TTF_GetFontKerning among others

I am having trouble linking SDL_ttf against a project I am developing on Mac OS X Snow Leopard. I am compiling SDL_ttf from source because I implemented my own function for getting the kerning between two characters in the library's source code (I am making my own kerning-accurate glyph management system for a game). For some reason, even when I declare the function like I'm supposed to:

extern DECLSPEC int SDLCALL TTF_GetKerningBetween(const TTF_Font *font, Uint16 previous, Uint16 next);

Xcode has trouble linking my game with SDL_ttf, saying that the symbol isn't found. It also does this with TTF_GetFontKerning and TTF_GlyphIsProvided, two other functions that I need. I am compiling in Xcode 3.2 using 10.4 as my base SDK, "Development" configuration, "Framework" target, and x86_64 architecture.

What could possibly be causing this problem? How are these functions (which are declared in SDL_ttf.c) not getting compiled in?

For reference, here's my TTF_GetKerningBetween function. Hope I did that right.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
int TTF_GetKerningBetween(const TTF_Font *font, Uint16 previous, Uint16 next)
{
	int kerning = 0;
	FT_Bool use_kerning;
	FT_UInt left, right;
	FT_Vector delta;
	FT_Error err;
	
	use_kerning = TTF_GetFontKerning( font );
	left = FT_Get_Char_Index( font->face, (FT_ULong)previous );
	right = FT_Get_Char_Index( font->face, (FT_ULong)next );
	
	if( use_kerning == 1 )
	{
		err = FT_Get_Kerning( font->face, left, right, ft_kerning_default, &delta );
		if( err == -1 )
			TTF_SetError( "Error getting kerning metrics." );
		else
			kerning = (int)delta.x >> 6;
	}
	return kerning;
}

-Morgan
What does your link command look like? And are you "installing" your version of SDL_ttf system wide?

My first thought would be that you have the original SDL_ttf lib installed and are ending up linking against it...
Topic archived. No new replies allowed.