What is freeglut.lib?

When I was compiling, it showed the following mistakes:

Linking…
LINK : fatal error LNK1104: cannot open file “freeglut.lib”
Error executing link.exe.

shader.exe - 1 error(s), 0 warning(s)

I found the freeglut.lib in my computer, but I cann’t find it. So I really do not know what it is.
And I am compiling the program in Microsoft VisulStudio using vc++6.0; And the headfiles are all included, and also I linked the opengl32.lib; glu32.lib;glaux.lib in the setting. But I really don’t know why this happens.
What on earth is this freeglut.lib? And how can I make my program run?

And the following is the first lines of my program:
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <math.h>

#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#include <GL/glx.h>
#include <GL/glext.h>

#include “utility.h”
#include “glUtils.h”

I copied all the needed headfiles into the proper places.

And by the way , this program is not written by myself, I just download the source code, and want to see what will happen after compiling.

Thank you for your help!

You must have freeglut listed somewhere in your project or possibly even in your headers/source files (perhaps a pragma statement).

Basically freeglut is an opensource (freely distributable, modifiable, etc) implementation of glut (licensed by SGI). Although the source for glut is freely available the license does not allow distribution of modifed code. You can read more about it here . It is more for Linux and I’m not sure if they have a Windows port but it is being used by Redhat, Fedora Core and several other Linux distros. I use it in Linux but I use Nate’s glut for WIndows in Windows. There are for freeglut some slight variations in the parameters passed to various functions and there have been some functions added. Otherwise the core of glut remains the same.

Download glut from Nate Robin's site and install the headers under vc7\PlatformSDK\include\GL the lib under vc7\PlatformSDK\lib and the dll under Windows\system where Windows is your Windows installation directory. Then you just need to change freeglut.lib references to glut.lib

Hope that helps…

Thank you.
And I did all of your instructions, but no, it still did not help. I am really confused what the problem is !

Looking a little farther I now notice that you have glx.h #included - this is a gl header specifically for GLX - GL for X Windows (typically Unix/Linux platforms) which I doubt you have unless you are using cygwin (with X) or some third party X server. Not sure where you got the code but you’ll likely want to modify it for ms vc/vs.

Ah, I see.
Yes, I was using cygwin.But it does not support X windows display. So I switched to MS VC++, and the problem came out.
And now the situation is :
I did what you said, that is downloading the freeglut source code and compiling it in order to gain the freeglut.lib; but when compiling using the MS VC++, there are errors, and when I switched to cygwin, I found out that the makefile is not complete, when commanding “make”,it just did not go on. But it still made a freeglut.lib in the Debug folder when using the MS VC++, and I copied it to the Lib folder of the MS VC98 folder(I am using the MS VC6.0); and when compiling my program again, the error of “cannot find freeglut.lib” does not come out again, instead, there are such errors:

Linking…
shader.obj : error LNK2001: unresolved external symbol _CheckGL
shader.obj : error LNK2001: unresolved external symbol _gluSphere
shader.obj : error LNK2001: unresolved external symbol _gluLookAt
shader.obj : error LNK2001: unresolved external symbol _gluPerspective
shader.obj : error LNK2001: unresolved external symbol _gluQuadricDrawStyle
shader.obj : error LNK2001: unresolved external symbol _FailNull
shader.obj : error LNK2001: unresolved external symbol _gluNewQuadric
shader.obj : error LNK2001: unresolved external symbol _glProgramStringARB
shader.obj : error LNK2001: unresolved external symbol _glBindProgramARB
shader.obj : error LNK2001: unresolved external symbol _glGenProgramsARB
shader.obj : error LNK2001: unresolved external symbol _Fail
Debug/shader.exe : fatal error LNK1120: 11 unresolved externals

I don’t know whether these errors are related to the incompleteness of the compiling of the freeglut source code. Or is it related with something else, such as the CG parameters?

Thank you very much for your help!

Actually, cygwin does support X Windows. However, it isn’t installed by default. To install it, run the cygwin setup.exe program. There are a list of available packages and under X I believe there will be a list of X packages that you can install. I am in Linux right now so I can’t tell you which ones need to be installed but startx, xterm, glx, freeglut or perhaps glut is available in another section probably graphics as well perhaps as opengl development packages. Be sure to also install gcc and gmake/make and any other development packages you may need (automake, autoconf, libtool, etc) which I assume you already have the ones you need.

To run an X/GLX program in cygwin requires that you start the program from an xterm rather than the default terminal (shell console) provided by cygwin (i.e. just launching cygwin). Running the xterm may start the x server automatically (can’t remember) - if not use the startx program to start it.

As far as the new errors you are getting, it suggests that you didn’t link against glu32.lib for the glu functions. The _CheckGL, _FailNull and _Fail I do not know which libraries they may be from. And the ARB extension functions weren’t properly instantiated - verify that your video card/drivers support the extensions or weren’t defined properly.

I did what you told, installing the cygwin again.
And now there’s a cygwin-X icon in my program, and there are many many more choices, such as Editors; toys; xterm; etc. But when I press them, nothing happens. No window appears. And when running the program in the cygwin, it still shows: unable to display. I don’t know what the problem is.

And also, I have another question, which concerns about opengl:
I know opengl is an API for drawing pictures.
But now I am looking into how opengl is deduced, which means how do the base functions of opengl be organized, what is the mechanism?
I have download the specification of the opengl by ARB, but I cann’t see which passage can help.