Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » Undefined reference to al_init_ttf_addon

This thread is locked; no one can reply to it. rss feed Print
Undefined reference to al_init_ttf_addon
Jensen
Member #14,073
February 2012

Hello all

I have installed allegro and code::blocks using this guide
http://www.allegro.cc/forums/thread/606041

Now i am trying to learn to use allegro using this tutorial
http://fixbyproximity.com/2d-game-development-course/

But in part 2.3 of the toturial the part about fonts and text i get this faliure when i try to compile.

obj\Debug\main.o||In function `main':|
C:\CodeBlocks\FirstGui\FirstGui\main.cpp|27|undefined reference to `al_init_ttf_addon'|
||=== Build finished: 1 errors, 0 warnings ===|

have i done something wrong doing installation and or is there something i can do to fix the problem?

Thanks

Matthew Leverton
Supreme Loser
January 1999
avatar

Link with the ttf addon.

Jensen
Member #14,073
February 2012

Hi

Thanks for the answer.
I have tried to link to the folder in the search directories tap.
C:\CodeBlocks\MinGW\allegro\addons\ttf\ and
C:\CodeBlocks\MinGW\allegro\addons\ttf\allegro5
just to be sure i had the right path i linked both but i still have the problem.

Can it be something else or did i not link it correctly?

Matthew Leverton
Supreme Loser
January 1999
avatar

You must link with files ending in .a for MinGW. See step 17 in the guide you posted. You need to do the same for the font and ttf .dll.a files.

If you build Allegro yourself, you may not have those files because you must have FreeType installed when you build Allegro. If you don't have those files, you can download prebuilt files. They are named slightly differently from the source version, but the same principles apply (include the header and link to the .a file).

Jensen
Member #14,073
February 2012

Thanks for the help.

I was not able to make it work in windows. But i finaly got the time to set it up on my linux com and it works now :)

Go to: