【发布时间】:2013-06-01 22:44:06
【问题描述】:
我的 OpenGL C++ 项目突然停止识别 glMatrixMode(GL_MODELVIEW)。我去吃晚饭,然后我的项目无法构建。
我正在使用带有 CDT 插件的 Eclipse 中的 Windows 7 64bit C++。为了设置静态链接库,我去了:项目属性 > C/C++ 构建 > 设置 > MinGW C++ 链接器 > 库 > 添加:glut32、glu32、opengl32 和 gdi32
代码如下:
#ifdef __APPLE_CC__
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif
...
void initialize() {
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(-45.0, 4.0 / 3.0, 1, 40);
glMatrixMode(GL_MODELVIEW); // <--------------- 'GL_MODELVIEW' was not declared in this scope
// full error: ..\main.cpp:103:15: error: 'GL_MODELVIEW' was not declared in this scope
glLoadIdentity();
gluLookAt(5,5,5, 0,0,0, 0,-1,0);
}
我已重新下载所有 OpenGL 库,重新创建项目,将库重新链接到项目,并清理项目并重新构建。我什至重新下载了eclipse并重新安装了C++插件。
【问题讨论】:
-
你晚餐喝得有多醉? ;-)
标签: c++ eclipse opengl eclipse-cdt