VS2017 build OpenGL environment GLTools freeglut glew glut freeglut_static Violent simple configuration!

table of Contents

1. Download the configuration file package

2. Start to build OpenGL environment

test

Circumstances that may report an error


Reprinted from: https://www.cnblogs.com/zpcdbky/p/6724772.html

1. Download the configuration file package

Download Baidu network disk resources: https://pan.baidu.com/s/1f30SrLnWCDHoRF7QkRWtVg 
Extraction code: s50o 

2. Start to build OpenGL environment

1. Unzip the downloaded "OpenGL configuration file package.zip"

2. Configure freeglut

Unzip the freeglut-MSVC-3.0.0-2.mp.zip of freeglut
2.1 Copy the .h files except glut.h in the \freeglut-MSVC-3.0.0-2.mp\freeglut\include\GL folder Go to D:\Visual Studio 2017\VC\Tools\MSVC\14.16.27023\include\gl in the VS installation directory and
change the freeglut in the \freeglut-MSVC-3.0.0-2.mp\freeglut\lib folder. Copy lib to D:\Visual Studio 2017\VC\Tools\MSVC\14.16.27023\lib\x86
2.3 Copy freeglut.dll under \freeglut-MSVC-3.0.0-2.mp\freeglut\bin folder to C:\Windows\System32

3. Configure glew

Unzip glew-2.0.0-win32.zip in the glew/compiled folder
3.1 Copy all .h under \glew-2.0.0\include\GL to D:\Visual Studio 2017\VC\Tools\MSVC\ 14.16.27023\include\gl
3.2 Copy all .lib under \glew-2.0.0\lib\Release\Win32 to D:\Visual Studio 2017\VC\Tools\MSVC\14.16.27023\lib\x86
3.3 Copy Copy the .dll under \glew-2.0.0\bin\Release\Win32 to C:\Windows\System32

4. Configure gltools

4.1 Copy all the .h under \gltools\include to D:\Visual Studio 2017\VC\Tools\MSVC\14.16.27023\include\ [Note: it is in include, not include\gl!
4.2 Copy all the .lib under \gltools\lib to D:\Visual Studio 2017\VC\Tools\MSVC\14.16.27023\lib\x86
4.3 Copy under \glew-2.0.0\bin\Release\Win32 Copy .dll to C:\Windows\System32

5. Configure glut

Unzip
glutdlls37beta.zip under glut 5.1 Copy the .h under \glut\glutdlls37beta to D:\Visual Studio 2017\VC\Tools\MSVC\14.16.27023\include\gl
5.2  Copy the .lib under \glut\glutdlls37beta Copy to D:\Visual Studio 2017\VC\Tools\MSVC\14.16.27023\lib\x86
5.3 
Copy the .dll under \glut\glutdlls37beta to C:\Windows\System32

test

Create a new window program

Delete the built-in FirstOPGLTest.cpp (or comment out the main function)

Add all the files in the following figure of the configuration file package to the project

Run the code

So far, congratulations on setting up the OPGL environment!

Circumstances that may report an error

When I first tried, I forgot to delete the original .cpp file, because the original .cpp file has a main() function, and Block.cpp also has a main() function, which leads to conflicts and many strange errors occur, but I am deleting the original .cpp Or reopen the project after commenting the main() function of the original .cpp, and it will be normal. If there is still an inexplicable error, you can restart the computer to see. If it still doesn’t work, you may have to read the original text. This article is slightly different from the original~

Guess you like

Origin blog.csdn.net/qq_39574690/article/details/114146097