I’ve just tried to mesh the sphere using OpenGL in the last two days. The solution to configure OpenGL in VS2017 is as follows:
Running is the link of https://blog.csdn.net/xdg_blog/article/details/52864872 code, the following need library file is also for this code, need to add other library method.
1. Download glut in the website, website link: https://www.opengl.org/resources/libraries/glut/.
2. The downloaded file is as follows:
A. Put the two lib files Glut.lib and Glut32.lib into the directory:
D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\ Lib \x86
B. Put Glut. DLL and Glut32.dll into a directory: C:\Windows\syswow64
Under 64-bit Windows: 64-bit EXE and DLL are in the directory C :\ Windows \ System32, and 32-bit EXE and DLL are in the directory C :\ Windows \ SYSWOW64. So note that registering a 32-bit OCX or DLL on a Win64-bit system requires copying the 32-bit OCX or DLL to the C :\ Windows \syswow64\ directory. C :\ Windows \ SYSWOW64 \ REGSVR32 XXXXXXXX. OCX or DLL.)
C. In the directory: D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\ Include, create a new folder GL and put the header file in GL folder.
3. In VS2017, the configuration is as follows. First create a new C ++ project, then open the toolbar: Project ->; Properties:
A. general – & gt; Character set – & gt; Is not set
B. Linker ->; Conventional – & gt; Add the library directory, add OpenGL library file directory and its own library file directory. Write the path where the two lib files are placed.
D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\ Lib
D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\ Lib \x86
C. Linker ->; Input – & gt; Attach dependencies. Add the individual lib files from OpenGL (Glut.lib and Glut32.lib are the only ones added here), separated by English keyboard semicolons.
Note: There are other ways on the web to set: linker ->; System – & gt; Subsystem – & gt; SUBSYSYTEM: WINDOWS. But I’ve tried setting this to not work, so just leave it unset by default. (Although I don’t know why ~
Finally all the way down to determine the configuration of good ~