OpenGL should be present already - probably Freeglut / GLUT will be absent.
GLUT is very dated now and is not actively supported - so you should definitely use Freeglut. You do not have to change your code at all, and several additional functions appear.
You will find pre-packaged file sets here: http://freeglut.sourceforge.net/index.php#download If you do not see the "lib" folder, this is because you did not download the pre-packaged set. "Martin Payne Windows Binary Files" is located at the link above and is running on Windows 8.1 with Visual Studio 2013 at the time of this writing.
When you download them, you will find that the Freeglut folder has three subfolders: - bin folder: this contains dll files for runtime - include: header files for compilation - lib: contains library files for compilation / linking
Installation instructions usually suggest moving these files to the visual studio folder and to the Windows system folder. It is better to avoid this, as this makes your project less portable and makes it much harder if you ever need to change which version of the library you are using (old projects may suddenly stop working, etc.)
Instead (apologies for any inconsistencies, I base these instructions on VS2010) ... - put the freeglut folder in another place, for example. C: \ DEV - Open the project in Visual Studio - Open the project properties - There should be a tab for VC ++ Directories , here you must add the appropriate include and lib folders, for example: C: \ dev \ freeglut \ include and C: \ dev \ freeglut \ lib - (Almost) The final step is to make sure that the opengl lib file is actually linked at compile time. In the project properties, expand the linker menu and open the input tab. For additional dependencies, add opengl32.lib (you would assume that it would be connected automatically by simply adding GL / gl.h to your project, but for some reason this doesn't seem to be the case)
At this point, your project should compile OK. To run it, you also need to copy the freeglut.dll files to the project folder
dlivi Mar 26 '13 at 16:04 2013-03-26 16:04
source share