错误尝试使用OpenGL [英] Error while trying to use OpenGL

查看:157
本文介绍了错误尝试使用OpenGL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非常简单的C code中,我试图使用OpenGL。
当我包括下列文件

I have a very simple C code in which I am trying to use OpenGl. When I include the following files

#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#include <stdlib.h>

我得到以下错误(等等,但它们是相似的):
C:\\ Program Files文件\\微软的Visual Studio 8 \\ VC \\ PlatformSDK \\包括\\ GL / gl.h(1152):错误C2144:语法错误:'无效'应该是pceded $ P $;

I get the following error(and many more but they are similar): C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\GL/gl.h(1152) : error C2144: syntax error : 'void' should be preceded by ';'

但是当我包括

#include <windows.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#include <stdlib.h>

我得到以下错误
\\ mainfile.cpp(4):致命错误C1083:无法打开包含文件:'GL / glut.h':没有这样的文件或目录

I get the following error \mainfile.cpp(4) : fatal error C1083: Cannot open include file: 'GL/glut.h': No such file or directory

任何想法发生了什么?

我用的是XP,VS2005

I am using XP, VS2005

推荐答案

GLUT不是OpenGL的一部分。你需要安装它,这是错误的话。

GLUT isn't part of OpenGL. You need to install it, which is what that error says.

这篇关于错误尝试使用OpenGL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆