user969416
user969416

Reputation:

SDL C++ ttf linker errors

I'm using CodeBlocks and trying to link SDL_ttf when compiling my program. I have followed thus instructions:

Add "-lSDL_ttf" in the linker command line
Put SDL_ttf.dll in library directory
Put SDL_ttf.h in include file directory

And I have this error when compiling:

ld.exe||cannot find -lSDL_ttf|
||=== Build finished: 1 errors, 0 warnings ===|

I've tried so many methods to solve this and I feel like banging my head against a brick wall.

I'm running Windows and I have moved the .dll to my system32 as well as the project folder and put the header files in my compilers includes folder.

Upvotes: 1

Views: 3698

Answers (2)

alshira
alshira

Reputation: 21

you have to use -lSDL2_ttf instead -lSDL_ttf

Upvotes: 2

Adam Rosenfield
Adam Rosenfield

Reputation: 400672

You also need the .lib file to link against. Put the .lib file in your library directory; you may also need to add that directory to your linker's search path with the -L <path> option.

Upvotes: 2

Related Questions