Following the Superbible, broken?

I’m a fairly experienced UN*X programmer trying to pick up OpenGL from the 5th edition superbible using VisualStudio 2008 on Windows (so … dealing with new windows things in addition to dealing with OpenGL…)

The first program to try is in the 2nd chapter — it’s going to put a triangle in a window — I appreciate the simplicity of a “hello world” program. For those that don’t have it, the superbible is using GLEW and and GLUT as it’s helper libraries.

The program is simple enough, and I even used the copy from the web (in case my own typing was not accurate enough). It compiles, but it crashes.

There are two issues that I’m fighting. The first is that glewInit() is returning a ‘1’ … which matches a “GL version error” and the second is that returning from main() or calling exit(1) causes atexit() calls in glut that dereference null pointers (bad form).

The 2nd issue isn’t really preventing my fun — it’s just a comment. The first issue, however, is preventing my fun.

Now… I’ve read a lot about windows and OpenGL. I’m using win7/64 and I have an nVidia 275 card installed with the 260.99 drivers. The OpenGL extension probe software (available somewhere on this site) lists OpenGL 3.2 as available.

Is GLEW not really a good idea? The superbible seems to be really recently published… so it seems wierd that it’s examples would already be broken.

Apparently you are not alone having problems with Superbible examples on windows, doing a search on these forums provides :

http://www.opengl.org/discussion_boards/…true#Post285420

http://www.opengl.org/discussion_boards/…amp;Search=true

HTH

Well… thank-you for pointing me to my own post in the windows forum. :slight_smile:

The other post is someone complaining about chapter 7 stuff. Neither offers any solution. The 2nd post also seems to slag the books examples as not running. Did I buy a dud book? Is it just GLEW and GLUT that suck?

Sorry I missed that :slight_smile:
Does the (free)GLUT and GLEW versions come from the book, or official versions, or latest snapshots … ?

I think that I’ve tried both. I’ve tried the binary versions from the book. I’ve tried compiling the versions from the book — which strangely left me with unresolved symbols.

It might be worth saying (too) that I tried the download ZIP file for the book and the svn checkout.

I’ve tried binary versions linked by this site (same result) and I’ve tried compiling them — but the versions linked by this site have older project files that I can’t seem to import into VS2008 express … and I haven’t (yet) started crawling through documentation to determine how libraries are made in VS.