GLUT in Linux: howto?

I’m using Redhat 8.0 and I’m a unix/GL beginner (not really a newbie anymore) and I’m breaking away from windows. I think the final straw was when Windows XP stopped booting up a few minutes ago and then started again. Maybe its hardware problems but I’m betting linux will cope with them better anyways but onto my question:

How do I get GLUT to work under linux? The only RPM’s I can find on rpmfind.net are “src” rpm’s and when I install em all I get is a bunch of header files and shannanigins.

The wierd thing about redhat linux that I’ve noticed is that after installing it gl.h, glu.h, and all that other good stuff is there and I include it and it compiles fine. But there’s no glut.h!!! Does redhat use mesa? Is that what these gl header files are?

Thanks for your help

Nevermind I figured it out. For those wondering how, the secret is to get the glut development package as well.

And you can also go direct to the RedHat-> Download, then search “glut” you will get two RPMs for glut. h

ok well now when I compile my GLUT basecode that I wrote I get a segmentation fault. Very strange, I’m totally stoked. Is there some general reason for why this would happen? It compiles fine…

Perhaps a wrong version of Xfree86, version 4.0.0 has quite a few bugs in it… Upgrade to the latest stable version

I’m using redhat 8.0 which is fairly new, wouldn’t the version on that be good enough?

Originally posted by 31337:
ok well now when I compile my GLUT basecode that I wrote I get a segmentation fault. Very strange, I’m totally stoked. Is there some general reason for why this would happen? It compiles fine…

Does it seg. fault immediately you run it? What happens if you run it under the debugger?

Well I’m not sure how to use g++'s debugger. I commented out virtually every line in the glut code and it still segmentation faulted. Like 2 commands after the glutInit command I believe. Do I need to be more specific?

Compile your program with -ggdb3 compiler switch. Then gdb <program> to start debugging. Take a look at this refcard for the commands. http://www-inst.eecs.berkeley.edu/~cs61c/resources/gdb-refcard.pdf

Personally, I use gdb from within emacs. Works pretty well.

Only time I’ve had a seg. fault from a GLUT program is when passing incorrect arguments to glutInit().

I will try that debugger thing when I get home. Maybe I’m passing incorrect arguements to glutInit? I just pass it the things my main function takes. Should I post the source code here? I bet that would help heh

I booted up redhat half an hour ago and it says my xfree86 server failed to start… never gotten that one before :stuck_out_tongue:

I’m starting to think its not my code’s fault but my linux setup. hmm…

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.