al_draw_text doesn´t work
Sven Gallin

hi folks,

i have tried to get al_draw_text working but it wont work.
an the end, to minimize my coding-faults, i have compiled the example code from

http://wiki.allegro.cc/index.php?title=Allegro_5_Tutorial/Addons/Fonts

1:1 (with download of the pirulen.ttf font) and if i run the .exe he still crashes. gdb says:
Starting program: M:\test.exe
[New Thread 1284.0x890]
[New Thread 1284.0xf74]
[New Thread 1284.0xcd8]
[New Thread 1284.0x544]

Program received signal SIGSEGV, Segmentation fault.
0x6428de49 in al_draw_ustr () from M:\allegro-5.0.7-monolith-mt.dll

compiler is gcc 4.7.0(mingw), allego 5.0.7 monolith-mt, os: win7 64.
what can i do to fix this?

thanks.

AleX-G Squadron

Have you tried to change the pirulen.ttf to arial.ttf?

J-Gamer

Have you checked the return value when you load the font? ie: the font isn't NULL?

Sven Gallin

yes, have tried arial also and the return value of al_load_ttf_font
is already tested in the example code:
if (!font){
fprintf(stderr, "Could not load 'pirulen.ttf'.\n");
return -1;
}

Arthur Kalliokoski

The example you pointed to doesn't use al_draw_ustr(), is that the only line of code you changed? Could you post it?

Sven Gallin

>The example you pointed to doesn't use al_draw_ustr(), is that the only line of code you changed?

i haven´t change any piece of the code. but gdb gives me this error.

Matthew Leverton

I don't think the binaries are compatible with gcc 4.7. If your code is correct, that is probably your problem.

Sven Gallin

>I don't think the binaries are compatible with gcc 4.7. If your code is correct, that is probably your problem.

yes, that was it. have downloaded 4.6.2 and now it works.
thank you:
D.

Thread #610886. Printed from Allegro.cc