VS2015 configure freeglut

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
write picture description here

  1. Where is the source code: Fill in your decompression directory here. For example, my decompression directory D:\freeglut-3.0.0
  2. Where to bulid the binaries: This is where the compiled files are stored. For example, my new directory D: D:\freeglut-3.0
  3. Then click Configure, select as shown, and then click Finish in the lower right corner

  4. Then click Generate and wait for the generation. (don't forget this step)
    When the following appears, the compilation is successful

  5. Open the successfully compiled folder D:\freeglut-3.0, find freeglut.sln , and open it with vs2015.

  6. Use Release and Debug to generate solutions for each
    write picture description here

  7. Back to D:\freeglut-3.0, there are Release and Debug subdirectories in the lib folder.
    Under the Release folder: Under the under the Release folder
    Debug folder: Debug folder
    here we only need a freeglut.lib

  8. The freeglut.dll file is what we need, it can be found under D:\freeglut-3.0\bin\Release.
  9. There are *.h header files in D:\freeglut-3.0.0\include\GL

3. Configure the file to the directory

  1. 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
  2. freeglut.dll here my computer is 64 bit, put it in C:\Windows\SysWOW64 (32 bit computer should put it in C:\Windows\System32)
  3. 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)
    write picture description here

  4. 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

    write picture description here

  5. 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.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325638718&siteId=291194637