1. Download
(1) freeglut: Freeglut 3.0.0 (Released: 7 March 2015) Download the latest 3.0 version
(2) cmake: cmake-3.10.0-rc4-win32-x86.zip compressed file save installation
2. Use cmake to compile freeglut
(1) Directly decompress and open \cmake-3.10.0-rc4-win32-x86\bin\cmake-gui.exe
- Where is the source code: Fill in your decompression directory here. For example, my decompression directory D:\freeglut-3.0.0
- Where to bulid the binaries: This is where the compiled files are stored. For example, my new directory D: D:\freeglut-3.0
Then click Configure, select as shown, and then click Finish in the lower right corner
Then click Generate and wait for the generation. (don't forget this step)
Open the successfully compiled folder D:\freeglut-3.0, find freeglut.sln , and open it with vs2015.
Use Release and Debug to generate solutions for each
Back to D:\freeglut-3.0, there are Release and Debug subdirectories in the lib folder.
Under the Release folder: Under the
Debug folder:
here we only need a freeglut.lib- The freeglut.dll file is what we need, it can be found under D:\freeglut-3.0\bin\Release.
- There are *.h header files in D:\freeglut-3.0.0\include\GL
3. Configure the file to the directory
- Put the freeglut.lib obtained above into C:\MyProgram Files\Visual Studio 2015\VS 2015\VC\lib. C:\MyProgram Files This is a folder I created myself
- freeglut.dll here my computer is 64 bit, put it in C:\Windows\SysWOW64 (32 bit computer should put it in C:\Windows\System32)
Put the *.h header files under D:\freeglut-3.0.0\include\GL into C:\MyProgram Files\Visual Studio 2015\VS 2015\VC\include\GL (if there is no GL folder in include, you can create a new one)
The most important step is to prevent the 1104 error when generating the solution file, and add NDEBUG to the new project properties of vs2015 . As shown below
Linker --> enter
opengl32.lib
freeglut.lib
glew32.lib
Here is the complete vs2015 configuration freeglut. Of course, you also need to configure a glew, which is relatively simple, and I will write it in a future blog.