# FTGL Seg Faults on Win32

**URL:** <https://www.ruby-forum.com/t/ftgl-seg-faults-on-win32/60228>\
**Category:** Ruby\
**Created:** [May 11, 2006, 11:16am UTC](https://www.ruby-forum.com/t/ftgl-seg-faults-on-win32/60228 "2006-05-11T11:16:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![xavier](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/2bfe46/32.png) [@xavier](https://www.ruby-forum.com/u/xavier)\
**Post date:** [May 11, 2006, 11:16am UTC](https://www.ruby-forum.com/t/ftgl-seg-faults-on-win32/60228/1 "2006-05-11T11:16:48Z")

</div>

Hi,  
I’m trying to use FLGT ruby on Windows XP, but am running into a  
segmentation fault at ftgl\_test.rb:38 (The first call through to the  
FTGL library)

I am installing as follows:

1. Ruby O. Click installer for windows
2. Install ruby-opengl-0.32g  
ruby extconf.rb  
nmake

At this point the openGL samples work  
3) Install FTGL  
ruby setup.rb config  
ruby setup.rb setup  
ruby setup.rb install  
4) Try to run ftgl\_test.rb  
ruby tests/ftgl\_test.rb

tests/ftgl\_test.rb:38: [BUG] Segmentation fault  
ruby 1.8.4 (2005-12-24) [i386-mswin32]

This application has requested the Runtime to terminate it in an unusual  
way.  
Please contact the application’s support team for more information.

I am at a loss as to how to go about debugging this problem. Any  
suggestions?

I’ve got the linux build running on ubuntu with no problems.

- Xavier

OS: Win XP SP2, Fully patched  
Ruby: 1.8.4 (2005-12-24) [i386-mswin32]  
msvc: Visual Studio .NET 2003

---

<div class="post-metadata">

**Author:** ![xavier](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/2bfe46/32.png) [@xavier](https://www.ruby-forum.com/u/xavier)\
**Post date:** [May 11, 2006, 4:05pm UTC](https://www.ruby-forum.com/t/ftgl-seg-faults-on-win32/60228/2 "2006-05-11T16:05:04Z")

</div>

You could try using the FxRuby OpenGL bindings.

---

<div class="post-metadata">

**Author:** ![xavier](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/2bfe46/32.png) [@xavier](https://www.ruby-forum.com/u/xavier)\
**Post date:** [May 11, 2006, 6:07pm UTC](https://www.ruby-forum.com/t/ftgl-seg-faults-on-win32/60228/3 "2006-05-11T18:07:15Z")

</div>

From: “Xavier” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> At this point the openGL samples work  
> 3) Install FTGL  
> ruby setup.rb config  
> ruby setup.rb setup  
> ruby setup.rb install  
> 4) Try to run ftgl\_test.rb  
> ruby tests/ftgl\_test.rb
> 
> tests/ftgl\_test.rb:38: [BUG] Segmentation fault  
> ruby 1.8.4 (2005-12-24) [i386-mswin32]

Hi,

That’s strange. I’ll try to reproduce that problem here.  
However, I’ve compiled it pretty recently on XP with  
1.8.4 and it’s been working for me. I’ve put the binaries  
online here:

[http://tastyspleen.net/~billk/ftgl\_mswin32/](http://tastyspleen.net/~billk/ftgl_mswin32/)

Do these binaries work for you? Or do you still get the  
crash?

Thanks,

Bill

---

<div class="post-metadata">

**Author:** ![xavier](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/2bfe46/32.png) [@xavier](https://www.ruby-forum.com/u/xavier)\
**Post date:** [May 12, 2006, 1:49pm UTC](https://www.ruby-forum.com/t/ftgl-seg-faults-on-win32/60228/4 "2006-05-12T13:49:47Z")

</div>

From: “Xavier” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> > Do these binaries work for you? Or do you still get the  
> > crash?
> 
> No, unfortunately ☹ I tried on two different machines, also.  
> I placed them in the following locations:  
> ruby\bin\libftgl.dll  
> ruby\lib\libftgl.lib (Is this even required?)

libftgl.lib is not required, no. I just included it for completeness  
sake in case  
you needed to link with it at some point.

> ruby\lib\ruby\1.8\i386-mswin32\ftgl.so
> 
> I’m thinking I might try and write a test harness in C++, this would  
> give me more info to work with (if it crashed), yes? At the moment, I’ve  
> got no idea where the problem is.
> 
> Also, FYI you can’t access .rb files stored on your server, but I  
> presume ftgl\_test.rb is the same as the one in the latest release.

Oops! Yes, ftgl\_test.rb is the same as the released version, except  
I hacked the paths slightly so that it would load the .dll and .so files  
out of the current directory. E.g.

ENV[‘PATH’] += “;.”  
$:.unshift “.”

Well, this is peculiar. Why would it run fine on my system and crash  
on yours, when we appear to have the same versions of various  
software.

Have you tried building FTGL itself from source? I’m wondering if  
it’s own C+±based demos would run on your system?

Regards,

Bill

---

<div class="post-metadata">

**Author:** ![xavier](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/2bfe46/32.png) [@xavier](https://www.ruby-forum.com/u/xavier)\
**Post date:** [May 13, 2006, 3:29am UTC](https://www.ruby-forum.com/t/ftgl-seg-faults-on-win32/60228/5 "2006-05-13T03:29:16Z")

</div>

Bill K. wrote:

> From: “Xavier” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
> 
> > > Do these binaries work for you? Or do you still get the  
> > > crash?
> > 
> > No, unfortunately ☹ I tried on two different machines, also.  
> > I placed them in the following locations:  
> > ruby\bin\libftgl.dll  
> > ruby\lib\libftgl.lib (Is this even required?)
> 
> libftgl.lib is not required, no. I just included it for completeness  
> sake in case  
> you needed to link with it at some point.
> 
> > ruby\lib\ruby\1.8\i386-mswin32\ftgl.so
> > 
> > I’m thinking I might try and write a test harness in C++, this would  
> > give me more info to work with (if it crashed), yes? At the moment, I’ve  
> > got no idea where the problem is.
> > 
> > Also, FYI you can’t access .rb files stored on your server, but I  
> > presume ftgl\_test.rb is the same as the one in the latest release.
> 
> Oops! Yes, ftgl\_test.rb is the same as the released version, except  
> I hacked the paths slightly so that it would load the .dll and .so files  
> out of the current directory. E.g.
> 
> ENV[‘PATH’] += “;.”  
> $:.unshift “.”
> 
> Well, this is peculiar. Why would it run fine on my system and crash  
> on yours, when we appear to have the same versions of various  
> software.
> 
> Have you tried building FTGL itself from source? I’m wondering if  
> it’s own C+±based demos would run on your system?

In the process of getting the C++ FTGL demo to run, I noticed the  
default font is c:\winnt.… Not valid on my machine ☹ Changed it to a  
valid path and it works fine. Probably should throw an exception rather  
than segfault, but I’m not familiar enough with bindings to write a  
patch. If it’s a big deal to change, maybe mention it in the readme?

Thanks,  
Xavier

---

<div class="post-metadata">

**Author:** ![xavier](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/2bfe46/32.png) [@xavier](https://www.ruby-forum.com/u/xavier)\
**Post date:** [May 12, 2006, 8:41am UTC](https://www.ruby-forum.com/t/ftgl-seg-faults-on-win32/60228/6 "2006-05-12T08:41:57Z")

</div>

Oky wrote:

> You could try using the FxRuby OpenGL bindings.

I’m not sure these are what I’m after. I’m adding text support into my  
game rendering engine. Besides, FTGL is purdy.

Bill K. wrote:

> From: “Xavier” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
> 
> > At this point the openGL samples work  
> > 3) Install FTGL  
> > ruby setup.rb config  
> > ruby setup.rb setup  
> > ruby setup.rb install  
> > 4) Try to run ftgl\_test.rb  
> > ruby tests/ftgl\_test.rb
> > 
> > tests/ftgl\_test.rb:38: [BUG] Segmentation fault  
> > ruby 1.8.4 (2005-12-24) [i386-mswin32]
> 
> Hi,
> 
> That’s strange. I’ll try to reproduce that problem here.  
> However, I’ve compiled it pretty recently on XP with  
> 1.8.4 and it’s been working for me. I’ve put the binaries  
> online here:
> 
> [Index of /~billk/ftgl\_mswin32](http://tastyspleen.net/~billk/ftgl_mswin32/)
> 
> Do these binaries work for you? Or do you still get the  
> crash?
> 
> Thanks,
> 
> Bill

No, unfortunately ☹ I tried on two different machines, also.  
I placed them in the following locations:  
ruby\bin\libftgl.dll  
ruby\lib\libftgl.lib (Is this even required?)  
ruby\lib\ruby\1.8\i386-mswin32\ftgl.so

I’m thinking I might try and write a test harness in C++, this would  
give me more info to work with (if it crashed), yes? At the moment, I’ve  
got no idea where the problem is.

Also, FYI you can’t access .rb files stored on your server, but I  
presume ftgl\_test.rb is the same as the one in the latest release.

Thanks for you help,  
Xavier
