官网已经提供各个vs版本对应的编译好的库文件,所有不需要下载源码使用cmake编译,直接下载就可以了。
glfw下载地址:https://www.glfw.org/download
根据自己的机器选择
如果下载的64位,运行时选择x64。
下面时项目属性表
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<IncludePath>D:\ProgramFiles\OpenGL_vc17\include;$(IncludePath)</IncludePath>
<LibraryPath>D:\ProgramFiles\OpenGL_vc17\lib-vc2017;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<ItemDefinitionGroup>
<Link>
<AdditionalDependencies>opengl32.lib;glfw3dll.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<ClCompile>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup />
</Project>