opengl 的编译错误 从网上找了一天,help
源程序从网上找的,主要是想设置环境
工程中的设置已好,加上了三个库文件还是不行,
头文件和库文件路径已设置好,
#include <GL/gl.h>
#include <GL/glaux.h>
#include "glos.h"
#pragma comment(lib, "opengl32.lib")
#pragma comment(lib, "glu32.lib")
#pragma comment(lib, "glaux.lib")
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);
}
错误:
Compiling...
qa.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
Error executing cl.exe.
qa.obj - 3 error(s), 0 warning(s)
问题点数:30、回复次数:5Top
1 楼akiko(弥弥)回复于 2003-11-01 18:58:54 得分 15
顶部先加上#include <windows.h>Top
2 楼proware(www.liutao.org)回复于 2003-11-01 19:07:53 得分 0
还是不行,请教再 谢了Top
3 楼proware(www.liutao.org)回复于 2003-11-01 19:09:36 得分 0
换错误了,
e:\vc\qa\qa.cpp(8) : fatal error C1083: Cannot open include file: 'glos.h': No such file or directoryTop
4 楼zhucde(【風間苍月】★<==>★【虚拟闲人】)回复于 2003-11-01 19:12:15 得分 15
把'glos.h'拷贝到你的工程目录里Top
5 楼proware(www.liutao.org)回复于 2003-11-01 19:32:14 得分 0
我的机子里没有 glos.h ,可不可以发给我一个
xhj_3214@163.comTop




