VS2015 Steps for OpenGL library configuration

Source: Internet
Author: User
This article mainly for you in detail the Visual Studio 2015 OpenGL Library Configuration tutorial, with a certain reference value, interested in small partners can refer to

Write in front:

The recent use of OpenGL, just under the VS2015 configuration is a great effort, now my results directly to everyone, hoping to be able to configure OpenGL under the VS2015 readers to save some trouble.

Body:

Resource Address: OpenGL installation package

Resources are compiled well, can be directly used, pro-test available.

After downloading the resources, unzip "OpenGL install package. zip", under the "OpenGL installation Package" folder you can see the demo, Freeglut, Glew, Gltools, glut five folders, including demo is the sample program, the remaining four is the installation package.

The following is a simple configuration.

1.glew Configuration

Glew folder under the compiled and SRC two folders, where the compiled folder is a compiled installation package, and the SRC folder is the source code. Under the configuration of the compiled installation package, the source code under the SRC folder is prepared for installation Gltools (see appendix below). If you want to use the source code to install Glew readers, please explore by yourself. The installation steps are described below.

1. Unzip the "Glew-2.0.0-win32.zip" in the compiled folder to get the glew-2.0.0 folder.

2. Find the VS2015 installation directory, if it is installed on the C drive, mostly similar to C:\Program Files (x86) \microsoft Visual Studio 15.0 Such path, under the other disk, the directory is "d:\ software installation \ VS2015 ", in order to express convenience, the following are all under the directory to explain.

3. Locate the header file directory for C + +, as under "D:\ Software Installation \vs2015\vc\include", create a new GL folder under the Include directory (if not).

4. Copy the 4 header files under the Glew-2.0.0\include\gl folder in 1 to the GL folder in 3.

5. Copy the Glew32.dll under Glew-2.0.0\bin\release\win32 to the D:\ software installation \vs2015\vc\bin directory.

6. Copy the two lib files under Glew-2.0.0\lib\release\win32 to the D:\ software installation \vs2015\vc\lib directory.

Note that it is not necessary to copy the DLL files to C:\Windows\System32 or C:\Windows\SysWOW64.

At this point, the Glew configuration is complete.

2.glut Configuration

1. Unzip the "Glutdlls37beta.zip" under the Glut folder and get 5 files, respectively glut.h, Gult.dll, Glut32.dll, Glut.lib, Glut32.lib.

2. Copy the glut.h to the D:\ software installation \VS2015\VC\INCLUDE\GL directory.

3. Copy the Gult.dll, Glut32.dll to the D:\ software installation \vs2015\vc\bin directory.

4. Copy the Glut.lib, Glut32.lib to the D:\ software installation \vs2015\vc\lib directory.

At this point, the glut configuration is complete.

3.freeglut Configuration

1. Extract the "Freeglut-msvc-3.0.0-2.mp.zip" under the Freeglut folder to get the Freeglut folder.

2. There are 4 header files in the FREEGLUT/INCLUDE/GL directory, and 3 header files except Glut.h are copied to the D:\ software installation \VS2015\VC\INCLUDE\GL directory.

3. Copy the Freeglut.dll file from the Freeglut/bin directory to the D:\ software installation \vs2015\vc\bin directory.

4. Copy the Freeglut.lib file from the Freeglut/lib directory to the D:\ software installation \vs2015\vc\lib directory.

At this point, the Freeglut configuration is complete.

4.gltools Configuration

1. Copy all 11 header files under the Gltools\include directory to the D:\ software Installation \vs2015\vc\include directory (note that the include directory, not the GL subdirectory ).

2. Copy the Gltools.lib file from the Gltools\lib directory to the D:\ software installation \vs2015\vc\lib directory.

At this point, the Gltools configuration is complete.

At this point, OpenGL configuration is complete.

Test

1. Create a new WIN32 console application.

2. Copy all files under the Demo\block directory to the newly created project directory (as in this example, E:\OpenGLTest\OpenGLTest)

3. "Source file" right--"add" and "Existing Item" to add the Block.cpp file in 2 to the project.

4. Add #pragma comment (lib, "Gltools.lib") after the include statement for the Block.cpp file.

5. Compile and run with the following results:

Press the space bar, the central cube style will change, a total of 6 changes, 6 kinds of changes cycle.

Compilation generation method for Appendix Gltools.lib

note that to compile the build gltools.lib, you must first configure the Glew. The following describes the compilation steps.

1. Copy all 11 header files under the Gltools\include directory to the D:\ software Installation \vs2015\vc\include directory (note the Include directory, not the GL subdirectory).

2. Start VS2015 and create a Win32 application named Gltools.

3. Select "Static Library" to drop the pre-compile header.

4. Copy the 6 file files from the GLTOOLS\SRC directory to the newly created project directory (in this case, E:\gltools\gltools).

5. "Source file" right--"add"-"Existing Item" and add 6 files from 4 to the project.

Note that the glew.c here is the glew.c file in the GLEW\SRC\GLEW-2.0.0\SRC directory.

6. Build--Build Gltools

Compile will appear a big push "DLL link inconsistent" warning (in the next online can find methods have tried, all no use, want to know the solution of the reader is not willing to enlighten), but eventually compiled successfully.

7. The generated gltools.lib file can be found in the E:\gltools\Debug directory.

At this point, the Gltools build is complete.

Write in the back:

In the next Caishuxueqian, mistakes are unavoidable, we urge you to criticize, your criticism and help is under the inexhaustible momentum of progress.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.