I am reading the OpenGl superbible, and on the very first triangle program it will not run. the program compiles just fine but when i run it, it gave me the error message freeglut.dll is missing from your computer. I downloaded that and put it in the correct directory, and it said that MSVCR71.dll was missing, so i downloaded that and put it in the correct directory and it began to say "The procedure entry point __glutCreateWindowWithExit could not be located in the dynamic link library freeglut.dll." does anyone know what i am doing wrong? i followed all the directions that the book told me.
-
2You should never download just a DLL like that. In the case of `freeglut.dll`, you need the version that precisely matches the corresponding `.lib` file you used. In the case of `mscvr71.dll`, you need the entire runtime as a matching version set, and it needs to be properly installed. – David Schwartz Jan 04 '12 at 03:40
-
@LightnessRacesinOrbit: No, I removed it (taxidermy) – datenwolf Jan 04 '12 at 09:12
-
Place the dll that came with the download in the same directory as your program. – marsh Jul 31 '15 at 00:45
5 Answers
You can't just grab random DLLs off the interwebtubes and dump them on your PC. There are versioning issues to consider that you're completely bypassing. It should have been a hint when the MSVC runtime dependency didn't link up.
Install the freeGLUT package properly, in its entirety.

- 378,754
- 76
- 643
- 1,055
-
This information would be much better placed as a comment rather than an answer. – Kröw Jan 15 '23 at 02:25
I have had the same problem. Follow these steps:
Assuming that you have performed all steps given in the book.
- Download the source code from companion site…I think the folder is SB5 and its 92 MB.
- Then build the project named 'freeglut.vcproj'.
- It will produce freeglut.dll apart from other files.Put freeglut.dll into c:\windows\syswow64 folder and all is done.
You could just include the dll wherever your executable is, if you are running this MSVC, then you could for example put the dll inside of your Debug folder. Cleaning the folder would remove everything except that dll so you wouldnt have to worry about constantly recopying it. Furthermore, if you want an alternative solution you could just put the dll inside of you Windows/System32 folder, or in the case of 64 bit architectures you could put it inside of the System/SysWow64 folder
The freeglut.dll should be placed in the VS project folder. The dll is part of the MSVC package - http://www.transmissionzero.co.uk/software/freeglut-devel/

- 1,764
- 3
- 24
- 38
Isn't there any options on the compiler where you can link the libraries? For example, if you use DevC++, you should go to Project -> Project Options -> Parameters, and set the Linkers.

- 33
- 5