I can't get to SDL_ttf work

I developing under cygwin (and I’d like to be able to compile my
projects under MSVC++ too) and I need to be able to print some simple
text in my SDL programs. I can’t build SDL_ttf myself (see thread
above). Someone sent me a mingw build of SDL_ttf off-list and my
programs compile and link using it but exit right away.

I don’t like glut but I really miss glutBitmapCharacter() now. What
should I do? I need to be able to print some simple text in my SDL
programs (cout in the underlying console is not good enough for me) and
I want to continue using SDL but right now it seems I have no choice but
to go back to glut. :frowning:

Any help appreciated!

/ E

Hello Eric,

Wednesday, November 15, 2006, 12:45:42 PM, you wrote:

I developing under cygwin (and I’d like to be able to compile my
projects under MSVC++ too) and I need to be able to print some simple
text in my SDL programs. I can’t build SDL_ttf myself (see thread
above). Someone sent me a mingw build of SDL_ttf off-list and my
programs compile and link using it but exit right away.

“Exit right away” isn’t very helpful - why not run your program
through GDB or even add some printf() debugging and find out where
it’s causing an exit?

I don’t like glut but I really miss glutBitmapCharacter() now. What
should I do? I need to be able to print some simple text in my SDL
programs (cout in the underlying console is not good enough for me) and
I want to continue using SDL but right now it seems I have no choice but
to go back to glut. :frowning:

You could create a bitmap with the contents of a font you’d like to
print, and then use the blitter functions with appropriate rectangles
to print strings. This would be faster than using TTF fonts if you
don’t want resizable fonts or Unicode stuff.–
Best regards,
Peter mailto:@Peter_Mulholland

Peter Mulholland skrev:

Hello Eric,

Wednesday, November 15, 2006, 12:45:42 PM, you wrote:

I developing under cygwin (and I’d like to be able to compile my
projects under MSVC++ too) and I need to be able to print some simple
text in my SDL programs. I can’t build SDL_ttf myself (see thread
above). Someone sent me a mingw build of SDL_ttf off-list and my
programs compile and link using it but exit right away.

“Exit right away” isn’t very helpful - why not run your program
through GDB or even add some printf() debugging and find out where
it’s causing an exit?

(gdb) run
Starting program: /cygdrive/c/coding/OpenGL/TSBK05/lab1/1-3/sdl/1-3.exe
gdb: unknown target exception 0xc0000135 at 0x7c964ed1

Program received signal ?, Unknown signal.

Program exited with code 030000000465.
You can’t do that without a process to debug.
(gdb) bt
No stack.

I said exit right away. It doesn’t print anything no matter where I put
it. So the executable gets seriosuly messed up as soon as I link with
the TTF-library. Sigh.

I don’t like glut but I really miss glutBitmapCharacter() now. What
should I do? I need to be able to print some simple text in my SDL
programs (cout in the underlying console is not good enough for me) and
I want to continue using SDL but right now it seems I have no choice but
to go back to glut. :frowning:

You could create a bitmap with the contents of a font you’d like to
print, and then use the blitter functions with appropriate rectangles
to print strings. This would be faster than using TTF fonts if you
don’t want resizable fonts or Unicode stuff.

Sounds like an awful lot of work but thanks for the idea and for your reply.

/ E

Hello Eric,

Wednesday, November 15, 2006, 11:44:45 PM, you wrote:

(gdb) run
Starting program:
/cygdrive/c/coding/OpenGL/TSBK05/lab1/1-3/sdl/1-3.exe
gdb: unknown target exception 0xc0000135 at 0x7c964ed1

Program received signal ?, Unknown signal.

Program exited with code 030000000465.
You can’t do that without a process to debug.
(gdb) bt
No stack.

I said exit right away. It doesn’t print anything no matter where I put
it. So the executable gets seriosuly messed up as soon as I link with
the TTF-library. Sigh.

Typical of GDB to be useless.

0xC0000135 is the Windows “This application failed to initialize
properly” error. You might want to try grabbing a copy of Depends and
see if this helps.

This error is usually produced when some DLL is found but fails to
load.

Sounds like an awful lot of work but thanks for the idea and for your reply.

It seems that it’s so useful people have already done it. This looks
like a good start:

http://www.linux-games.com/sfont/--
Best regards,
Peter mailto:@Peter_Mulholland

I developing under cygwin (and I’d like to be able to compile my
projects under MSVC++ too) and I need to be able to print some simple
text in my SDL programs. I can’t build SDL_ttf myself (see thread
above).

Ever since I updated cygwin almost a year ago, I haven’t been able to get
it to compile my SDL using game, or SDL_ttf as well. Even before then I
had plently of trouble getting it to link successfully. I haven’t had
the same issues with either the GNU toolchain on Linux or MSVC++.
Hopefully you’ll also not have as much trouble with MSVC++.

Good luck!On Wed, 15 Nov 2006, Eric Lilja wrote:


Jeff Jackowski
http://ro.com/~jeffj/

Peter Mulholland skrev:

Hello Eric,

Wednesday, November 15, 2006, 11:44:45 PM, you wrote:

(gdb) run
Starting program:
/cygdrive/c/coding/OpenGL/TSBK05/lab1/1-3/sdl/1-3.exe
gdb: unknown target exception 0xc0000135 at 0x7c964ed1

Program received signal ?, Unknown signal.

Program exited with code 030000000465.
You can’t do that without a process to debug.
(gdb) bt
No stack.

I said exit right away. It doesn’t print anything no matter where I put
it. So the executable gets seriosuly messed up as soon as I link with
the TTF-library. Sigh.

Typical of GDB to be useless.

0xC0000135 is the Windows “This application failed to initialize
properly” error. You might want to try grabbing a copy of Depends and
see if this helps.

This error is usually produced when some DLL is found but fails to
load.

I will check out depends, thanks.

Sounds like an awful lot of work but thanks for the idea and for your reply.

It seems that it’s so useful people have already done it. This looks
like a good start:

http://www.linux-games.com/sfont/

Ok, tried it. It depends on SDL_image. So I downloaded SDL_image. But
SDL_Image seems to want at least libpng (the test program for the
library you linked uses .png) to be useful. So I installed libpng using
cygwin setup. But make insists on passing -mno-cygwin when compiling
so compilation fails. sigh

/ E