|
|||||||||||
How
to compile OpenGL with Microsoft's visual studio 6. |
|||||||||||
May 8, 2014 |
|||||||||||
page 1 (unfinished) |
|||||||||||
(the following is still just a rough sketch of
On numerous occasions I have had to start an OpenGL project from within a windows application. These are directions on how to get that started. A good source of online information can be found here: OpenGL In addition to the OpenGL api, I use the glut api to help deal with the window and keyboard controls. This howto assumes you have the following minimum setup: Windows XP SP2 Microsoft's visual studio version 6 (MS Visual C++ 6.0) OpenGL with the included files listed below.
To get MS VC++ going: file --> new --> Win32 Console App choose --> create new workspace Platforms: [v] Win32 choose --> An empty project --------------------------------------- then include the code files: (main.cpp, etc...) project --> Add to project --> files --------------------------------------- to get opengl to start: include this file into the project's directory: "glos.h" include statement: ... the include directory: C:\Program Files (x86)\Microsoft Visual Studio\VC98\Include\GL
The files opengl32.dll and glu32.dll should already be in your windows system folder. If not then they will need to be placed there... So, to run the executable, you will have to copy the files: opengl32.dll, glu32.dll, and glut32.dll into your system folder: C:\WINDOWS\system32
In order to be able to compile the code using Visual C++, you have to copy the .lib files into the lib folder of Microsoft Visual Studio, which is usually: C:\Program Files\Microsoft Visual Studio\VC98\Lib and the .h files into the GL folder: C:\Program Files\Microsoft Visual Studio\VC98\Include\GL .. If the GL folder is not found, then create it yourself.
Add the following to the top of the files that are making calls to the OpenGL functions: #include "glos.h" // MS specific stuff #include <GL/gl.h> // system OpenGL includes
... then we need to modify the library files in visual C++ ... project --> settings --> link --> project options add: opengl32.lib glu32.lib glaux.lib glut32.lib /nologo ... then it will link correctly. ---------------------------------------
I have placed these files here for easy access: dll files: opengl_dlls.zip
include files: \GL GL.H GLAUX.H glext.h GLU.H glu_.h glut.h GLOS.H lib: GLAUX.LIB GLU32.LIB OPENGL32.LIB ---------------------------------------
Possible errors from MS VC++ 6:
Linking... solution: Follow the above folder creations and file placements, then place a good copy of glut32.lib into the directories: C:\WINDOWS\system32 This should allow the linker to correctly find and open "glut32.lib".
|
|||||||||||