[ruby-opengl-devel] a wide answer to many mails

minh thu noteed at gmail.com
Thu Aug 31 06:46:39 EDT 2006

[too much different mails to respond to; so this new thread]

* John
> Thank you, but note, I think on most *nix systems, glut.h simply
> #includes freeglut_std.h. It does on mine.
> [ ... and some other mails ]

I didn't understood at first your note about glut.h / freeglut_std.h :
now I got it : you didn't understood at first why I did the change in
my diff then
you get the idea by yourself.

* all and in particular Peter
> Assuming the diagnosis is correct, there seem to be a couple of approaches:
> [ ... 1 and 2 ]

-includeall is, i think, a bad idea : from the SWIG documentation :
Like C, SWIG preprocesses all input files through an enhanced version
of the C preprocessor. All standard preprocessor features are supported
including file inclusion, conditional compilation and macros. However,
#include statements are ignored unless the  -includeall command line
option has been supplied. The reason for disabling includes is that SWIG
is sometimes used to process raw C header files. In this case, you
usually only want the extension module to include functions in the
supplied header file rather than everything that might be included by
that header file (i.e., system headers, C library functions, etc.).
Indeed, when I tried some days ago, SWIG was complaining about various
standard c header files it didn't find (because they were not in the path).

Also, when looking in freeglut_std.h, it #includes a lot of things
(directly or not).

So the second approach is, i think, better.

* Peter
>> Whoops. For that last string I meant: "--with-ldflags='-lGL'"
> I've updated the gl/rakefile.  Someone on linux should test.

I don't know what you meant here : gl/rakefile has indeed -lGL
but still, glut/rakefile has the whole -lGL -lGLU -lglut...

Whatever, I tried with only -lGL for gl/rakefile and -lglut for
glut/rakefile and it works fine. (this is what we all supposed).

Index: ext/glut/rakefile
--- ext/glut/rakefile   (revision 38)
+++ ext/glut/rakefile   (working copy)
@@ -23,7 +23,7 @@
     # Don't understand why swig doesn't define this...
     swig_args = "-DSWIGMAC"
-    extconf_args = "--with-ldflags='-lGL -lGLU -lglut'"
+    extconf_args = "--with-ldflags='-lglut'"
     swig_args = "-I/usr/include"

* about test.rb
I have the same behaviour as John (but I don't think the difference in behaviour
is because of our bindings).

Whoo, that was long, sorry,

More information about the ruby-opengl-devel mailing list