# Can't install SDL_ttf

This topic is 5471 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Although I have heard amazing things about SDL_ttf, the installation for Windows is crap. At first I was like "Hey... maybe it'll be as easy as installing SDL or OpenGL for that matter" BUT IT'S NOT. I put all the files that were in include and put them in Visual Studio.NET's VC7/include directory and put the lib file in the lib directory. I linked, but then I had no clue what header file to include or if I was even doing everything correctly. Help would be most appreciated.

##### Share on other sites
link the library, put the SDL_ttf.dll in the right directory (usually the same one your project is in), and then add the header <sdl_ttf.h>

post an error if you get one, but you shouldnt so far..

just

#include <sdl_ttf.h>

should do it

edit: just remembered about the freetype stuff. you have to get the latest version of freetype and install it. tell the VC++ Directories thing where the freetype includes and lib files are, and it will handle the rest

##### Share on other sites
I don't have the SDL_ttf.dll, what happened? Uggh, This is why I hate third-party libraries like this. They're so damn frustrating.

EDIT: Nevermind. Figured it out.

EDIT II: Well, now I can't initialize it. Here's my code and here's my errors:

	// Initialize SDL_ttf	if(TTF_Init()==-1) 	{    printf("TTF_Init: %s\n", TTF_GetError());    exit(2);	}------ Build started: Project: SDL Engine, Configuration: Debug Win32 ------Linking...LINK : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specificationmain.obj : error LNK2019: unresolved external symbol _TTF_Init referenced in function _SDL_main.\Debug/SDL Engine.exe : fatal error LNK1120: 1 unresolved externalsBuild log was saved at "file://d:\Projects\SDL Engine\Debug\BuildLog.htm"SDL Engine - 2 error(s), 1 warning(s)---------------------- Done ----------------------    Build: 0 succeeded, 1 failed, 0 skipped

##### Share on other sites
That error could be one of a couple of things.

1. SDL must be initialized ( SDL_Init( SDL_INIT_VIDEO ) ) before you call TTF_Init().

2. The library sdlmain.lib hasnt been entered into the Additonal Dependencies box in the Linker Input section of your project properties.

3. The project hasnt been set to multi threaded DLL

[Edited by - c-gibson-s on September 26, 2004 10:24:03 AM]

##### Share on other sites
Quote:
 1. SDL must be initialized ( SDL_Init( SDL_INIT_VIDEO ) ) before you call TTF_Init().

It says in the documentation that SDL doesn't have to be initialized to call TTF_Init(). Even so, SDL has already been initialized.

Quote:
 2. The library sdlmain.lib hasnt been entered into the Additonal Dependencies box in the Linker Input section of your project properties.

I'm adding this new library to an already exsisting SDL project. I have sdl.lib and sdlmain.lib already linked to the project. Is there some library that comes with SDL_ttf that I have to link to?

Quote:
 3. The project hasnt been set to multi threaded DLL

As I stated above, this is from an exsisting project and already set to a multi threaded DLL.

##### Share on other sites
Quote:
 Original post by Ekim_GramIs there some library that comes with SDL_ttf that I have to link to?

Yes. Whenever you get something thats in a DLL, you will almost always need a .lib to link to (unless you use GetProcAddress() on the DLL).
You should have got sdl_ttf.lib or something similar with the dll file. I'm nto sure about the exact name, its been ages since I used SDL...

##### Share on other sites
I can't seem to find any DLL or Library file to link to. I've gone through every directory that was included in the zip and I've come up with nothing whatsoever. I'm not sure if this would work but would anybody be so kind as to send me the DLL and lib files?

EDIT: Nevermind. Boy, am I ignorant. I realized that I had to build the project to get the DLL and library files. *smacks self* Thanks for all the help though!

##### Share on other sites
I'm right with you on the difficulties with the installation of SDL_ttf but it actually shields you with the complexities of trying to use / compile freetype 2.

I had exactly the same problems with installation a few weeks before you did ,but was able to fight through the debugging process to link them finally. You're doing the right thing by asking on the forum though, because that's where you find similar experiences and their resolutions.

##### Share on other sites
SDL has some of the best third pary addon libraries around.

what I do for all new libs I download, is drag and drop them into a dev directory on the c drive. You can just add the paths to the IDE.

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 15
• 22
• 17
• 46