代码如下:
#include <GL/gl.h>
#include <GL/glaux.h>
#include "glos.h"void main(void)
{
 auxInitDisplayMode(AUX_SINGLE|AUX_RGBA);
 auxInitPosition(0,0,500,500);
 auxInitWindow("simple"); glClearColor(0.0,0.0,0.0,0.0);
 glClear(GL_COLOR_BUFFER_BIT); glColor3f(1.0,0.0,0.0);
 glRectf(-0.5,-0.5,0.5,0.5); glFlush();
 _sleep(1000);
}出现如下错误:c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1153) : error C2144: syntax error : missing ';' before type 'void'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1153) : error C2501: 'WINGDIAPI' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1153) : fatal error C1004: unexpected end of file found
Error executing cl.exe.不知道是什么原因,请高手救命啊

解决方案 »

  1.   

    1、
    #include <gl/gl.h>
    #include <GL/glu.h>
    #include <GL/glaux.h>
    2、连接选项里加上:
    opengl32.lib glu32.lib glaux.lib
    3、正确设置库文件和头文件目录。
      

  2.   

    改两处
    1在 #include <GL/gl.h> 前加 #include "windows.h"
    2加连接:opengl32.lib glu32.lib glaux.lib
      

  3.   

    问题解决了,呵呵但是能告诉我为什么要把windows.h引用进来才能用呢??
      

  4.   


    error C2144: syntax error : missing ';' before type 'void'
    表示前面有什么东西没有定义。显然 WINGDIAPI 是需要windows.h的支持。