C++ – glut32.dll is missing error . A way to get rid of it on non-administrative access machines

copenglvisual studio 2012

I'm using visual studio 2012 on my university machines. On creating a project, saving glut.h, glut32.lib, and glut32.dll to my project folder and making sure it is in same directory as my .cpp files, i then add glut.h to my header files and glut32.lib to resource files and include glut.h as #include "glut.h" in my source folder i get an error glut32.dll is missing. I didn't change any directory path. How to resolve this.

Best Answer

The DLL needs to be in your working directory at run-time.

You can set this as a project/debugger option in Visual Studio (probably the better solution if you have shaders, etc.) or you can do the lazy thing and copy the DLL into your Debug/, Release/, etc. directory.

As a rule of thumb, I always have my projects run with a working directory of /NothingInc/Dev/ this is my base path for all resources including DLLs, shaders, textures, etc. It would be a good idea to adopt a similar policy for your projects, since they will probably share shaders and other resources, and they will certainly all need glut32.dll.