[SDL] SDL-ttf: Problem linking in global variable TTF_Initialized
bssnrw at bath.ac.uk
Tue Sep 3 05:11:00 PDT 2002
I'm trying to wrap the SDL_ttf library with a simple TTFont (truetype
font) C++ object. However, I'm running into problems linking in the global
variable TTF_Initialized when compiling programs using my TTF wrapper.
I attempt to use TTF_Initialized (a global variable representing whether
or not the SDL_TTF library is initialised or not, declared as a static int
in SDL_ttf.c) in the constructor of my TTFont class, to determine whether
or not the SDL_TTF library is initialised or not. I declare it as extern
in the header for my TTFont class.
However, on linking apps the (gcc) linker reports "TTF_Initialized:
undefined symbol" or similar. I use SDLttf-2.0.3, and compiled and
installed from source. And it's not anything obvious like getting the
library path wrong or forgetting to include SDL_ttf in the list of
libraries :-), ...as other SDL_ttf functions *are* recognised.
Has anyone else had similar problems while using the ttf library, or is
anyone able to suggest the cause of the problem? I really need to use
TTF_Initialised to avoid initialising the TTF library twice if I use two
TTF fonts in my program.
More information about the SDL