The first thing to download is glut.h Glut32.dll glut32.lib. (This is in Glut-3.7.6-bin's bag, can be downloaded directly)
And then:
Glut.h: Put it in D:\vs2013\VC\include\GL (create a new one without the GL folder)
Glut32.dll: Put in the D:\vs2013\VC\bin inside (recommended in C:windows\system32 also put one)
Glut32.lib: Put it inside the D:\vs2013\VC\lib.
Then directly suggest a Win32 console program, select Project->project property-> configurationproperties->linker->input-> Additional Dependencies in which to add opengl32.lib;glu32.lib;glut32.lib note that each. lib file is separated from each other, must not have a space, if error LNK1104: Cannot open File " ; Opengl32.lib "Such a mistake, very
This may be the result of a space.
Attach a simple OpenGL program, if the output of a red rectangle, then the configuration is successful.
//draw rectangle. CPP: Defines the entry point of the console application. //#include"stdafx.h"#include"gl/glut.h"voidInitialvoid) {Glclearcolor (1.0f,1.0f,1.0f,1.0f); Glmatrixmode (gl_projection); Gluortho2d (0.0,200.0,0.0,150.0);}voidDisplay (void) {glclear (gl_color_buffer_bit); glcolor3f (1.0f,0.0f,0.0f); GLRECTF (50.0f,100.0f,150.0f,50.0f); Glflush ();}intMainintargcChar*argv[]) {Glutinit (&argc, argv); Glutinitdisplaymode (Glut_single|Glut_rgb); Glutinitwindowsize ( -, -); Glutinitwindowposition ( -, -); Glutcreatewindow ("really is no language ... "); Glutdisplayfunc (Display); Initial (); Glutmainloop (); return 0;}View Code
Configure OpenGL in vs2013 (absolutely reliable!) )