永发信息网

vc下运行opengl程序报gl.h头文件有错

答案:3  悬赏:0  手机版
解决时间 2021-01-26 12:20
  • 提问者网友:爱了却不能说
  • 2021-01-26 04:33
Compiling...
rect.cpp
e:\program files\microsoft visual studio\vc98\include\gl\gl.h(1152) : error C2144: syntax error : missing ';' before type 'void'
e:\program files\microsoft visual studio\vc98\include\gl\gl.h(1152) : error C2501: 'WINGDIAPI' : missing storage-class or type specifiers
e:\program files\microsoft visual studio\vc98\include\gl\gl.h(1152) : fatal error C1004: unexpected end of file found
执行 cl.exe 时出错.

rect.exe - 1 error(s), 0 warning(s)

老是出现这样的错误 请高手指点一下该怎么解决阿
最佳答案
  • 五星知识达人网友:有你哪都是故乡
  • 2021-01-26 04:49
恩..不一定是gl的错误。
你试试看
#include<GL/gl.h>
int main()
{
}
编译有错误吗?

如果还是有错误,另外下一个gl.h
全部回答
  • 1楼网友:轮獄道
  • 2021-01-26 05:59
有没有加库进来啊。 在#include <GL/gl.h>后加上 #pragma comment(lib,"OpenGL32.lib")看看
  • 2楼网友:痴妹与他
  • 2021-01-26 05:12
/在窗口第一次创建时以及每次改变窗口大小或移动位置时调用此函数 void myreshape(int w, int h) { glmatrixmode(gl_projection); //设置矩阵模式为投影模式 glloadidentity(); //装入单位矩阵 glfrustum(-1.0,1.0,-1.0,1.0,1.5,20.0) //投影变换 最后一句前少了个分号
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯