我想使用OpenGL和C++来创建一个基本场景,其中包含一个“摄像机”(透视)和一个可以查看的对象。我找到了一个示例代码这里。但出于某种原因,尽管我把所有必要的包含和库绑定在一起(见下文),
// OpenGL init and components:
#include <glload/gl_3_3.h>
#include <glload/gl_load.hpp>
#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/freeglut.h>
#include <excpt.h>
#include <glm/glm.hpp>IDE ( 2012 for Windows桌面)不同意我的观点:

如果你需要更多的信息,请告诉我。
=============================================================================
更新:在修改了一些与opengl相关的文件之后,我想出了如下内容:
// Basics:
#include <windows.h>
#include <string>
#include <exception>
#include <stdexcept>
#include <stdio.h>
#include <stdlib.h>
// OpenGL init and components:
#include <glload/gl_3_1_comp.h>
#include <glload/gl_3_2_comp.h>
#include <glload/gl_3_3.h>
#include <glload/gl_4_0_comp.h>
#include <glload/gl_4_1_comp.h>
#include <glload/gl_4_2_comp.h>
#include <glload/gl_4_3_comp.h>
#include <glload/gl_4_4_comp.h>
#include <glload/gl_load.hpp>
#include <GL/glew.h>
#include <GL/freeglut.h>
#include <excpt.h>
#include <glm/glm.hpp>它告诉我,GLEW_OK是没有定义的,尽管它就在这里:
#define GLEW_OK 0发布于 2014-05-04 16:58:55
我知道你在用格鲁,你打电话给glewInit()了吗
还要确保您正在检查初始化是否成功。
GLenum err = glewInit();
if (GLEW_OK != err)
{
/* Problem: glewInit failed, something is seriously wrong. */
fprintf(stderr, "Error: %s\n", glewGetErrorString(err));
}或者,就像今天早上发生在我身上的这一样,重新启动解决了我的问题
https://stackoverflow.com/questions/23458752
复制相似问题