GLUT Problem

I’m a newbie, and I hope someone can help me out. I’m using devcpp on a windows 98 machine and I’m trying to use glutSolidSphere to draw a sphere. I’m getting an error that says
[Linker error] undefined reference to `glutSolidSphere@16’. I have included GL/glut.h and the glut.h header is in my devcpp/include/ folder. I have also made sure and glut32.dll is in the windows/system folder and libglut32.a is in the devcpp/lib folder. What else do I need to do to make sure that programs using glut will compile with devcpp? Thanks in advance for your time.

You also need to link with glut32 (i.e. -lglut32). Not sure how to do it under DevC++, but similar to how you link opengl32 & glu32, for instance.

Yep, that’s the step I forgot. Works like a charm now. For anyone reading this thread wondering how to do this in Devcpp, just go to Project->Project Options (or press Alt+P), then go to the Parameters tab, click on “Add Library or Object” near the bottom left corner, browse until you find libglut32.a, and click “Open.” This should get your glut programs compiling. Thanks Marcus.

i am also having a comiling problem with glut. i am using borland and whenever i compile (i type in “bcc32 framework.cpp glut32.lib” to compile the program) i get the usual warnings, and everything goes ok, but then i get this error at the bottom

ERROR: ‘C:\BORLAND\BCC55\LIB\GLUT32.LIB’ CONTAINS INVALID OMF RECORD, TYPE 0X21 (POSSIBLY COFF)

i cant figure out what i am doing wrong,could someone ples help, thanx

relpats_eht

This is a known issue when using lib-files that weren’t created by a borland compiler. borland uses a different format for it’s lib-files (namely OMF). This is different from Microsoft’s version, which is COFF.

Borland provides a small command line tool called coff2omf.exe which should be located in the \bin directory of your borland compiler.

just run the tool on your glut32.lib file and use the result to link with your program. Should work fine.

thanx alot.

I also have a problem using glutSoliSphere() with a material. I am wondering if this funciton uses texture coordinates. When I bind a texture and call this function I still see a uniform sphere whereas another mesh (with properly defined texture coordinates) is well textured…
any ideas? :-\

Hi. I also use Dev C++ (Dev C++ 4). I made a project, and I tried to link GLUT. It didn’t work for me.
I get the following Linker Errors:
“g++: c:\documents and settings\malcolm\my documents est\glut test est.o: No such file or directory”

“g++: file path prefix `C:\DEV-C_~1\Bin’ never used”

I have no clue what to do now. I don’t have a file called test.o, by the way.