When developing an OpenGL project, an error like the one shown in the figure can occur in the VS development environment.
OpenGL32.dll exists in the C :\ Windowssystem32 and SysWow64 folders. The program will compile normally, but will be prompted as soon as the program is running
“Could not start this program because OpenGL. DLL is missing from your computer. Try reinstalling the program to fix the problem.”
This is mainly due to the reference to both the static libraries “Glut.lib” and “Glut32.lib”.
That is, in the project ->; Property – & gt; Configure properties ->; The linker – & gt; Glut.Lib and Glut32.Lib are added to the attached dependencies, and Glut.DLL comes first, glut32.DLL comes second, so the linker first looks for OpenGl32.DLL instead of OpenGL32.DLL.
In addition, if you want to reproduce this error in VS, you need to rebuild the project after configuring the additional dependencies.
OpenGL32.dll exists in the C :\ Windowssystem32 and SysWow64 folders. The program will compile normally, but will be prompted as soon as the program is running
“Could not start this program because OpenGL. DLL is missing from your computer. Try reinstalling the program to fix the problem.”
This is mainly due to the reference to both the static libraries “Glut.lib” and “Glut32.lib”.
That is, in the project ->; Property – & gt; Configure properties ->; The linker – & gt; Glut.Lib and Glut32.Lib are added to the attached dependencies, and Glut.DLL comes first, glut32.DLL comes second, so the linker first looks for OpenGl32.DLL instead of OpenGL32.DLL.
In addition, if you want to reproduce this error in VS, you need to rebuild the project after configuring the additional dependencies.