Visual Studio 没有找到 GL/glut.h
Visual Studio doesn't find GL/glut.h
我在 Windows 10 上使用 Microsoft Visual Studio Community 2017,我一直在尝试使用 this online guide that I found on this Whosebug question 安装 GLUT。然而,当我尝试编译我的代码时,这个错误仍然出现:fatal error C1083: Cannot open include file: 'GL\glut.h': No such file or directory
。我逐行执行了每一步,但似乎没有任何效果。什么可能导致此错误?
这就是我导入依赖项的方式:
#include <iostream>
#include <Windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <GL/GL.h>
#include <GL/GLU.h>
#include <GL/glut.h>
#include <cstring>
#include "math.h"
#include <conio.h>
为此,我喜欢使用 Nuget 包管理器。如果你去
Tools>NuGet Package Manager>Package Manager Console
然后,在控制台输入:
Install-Package nupengl.core
您的问题应该已解决。
我在 Windows 10 上使用 Microsoft Visual Studio Community 2017,我一直在尝试使用 this online guide that I found on this Whosebug question 安装 GLUT。然而,当我尝试编译我的代码时,这个错误仍然出现:fatal error C1083: Cannot open include file: 'GL\glut.h': No such file or directory
。我逐行执行了每一步,但似乎没有任何效果。什么可能导致此错误?
这就是我导入依赖项的方式:
#include <iostream>
#include <Windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <GL/GL.h>
#include <GL/GLU.h>
#include <GL/glut.h>
#include <cstring>
#include "math.h"
#include <conio.h>
为此,我喜欢使用 Nuget 包管理器。如果你去
Tools>NuGet Package Manager>Package Manager Console
然后,在控制台输入:
Install-Package nupengl.core
您的问题应该已解决。