在VS2008中编译opengl出错了
代码如下// F.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include<stdio.h>
#include <gl/glut.h>
void init()
{
glClearColor( 0.0, 0.0, 0.0, 0.0 );
glShadeModel( GL_FLAT );
}
void display()
{
int i, j, k;
glClear( GL_COLOR_BUFFER_BIT );
glColor3f( 1.0, 1.0, 1.0 );
glLoadIdentity();
gluLookAt( -5.0, 3.0, 4.0, 0.0, 2.0, 0.0, 0.0, 1.0, 0.0 );
glPushMatrix();
for ( i = 0; i < 2; ++i )
{
glPushMatrix();
for ( j = 0; j < 2; ++j )
{
glPushMatrix();
for ( k = 0; k < 2; ++k )
{
glutWireCube( 1.0 );
glTranslatef( 0.0, 1.0, 0.0 );
}
glPopMatrix();
glTranslatef( 0.0, 0.0, 1.0 );
}
glPopMatrix();
glTranslatef( 1.0, 0.0, 0.0 );
}
glPopMatrix();
glFlush();
}
void reshape(int w, int h)
{
glViewport( 0, 0, (GLsizei) w, (GLsizei) h );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
glFrustum( -1.0, 1.0, -1.0, 1.0, 1.5, 20.0 );
glMatrixMode( GL_MODELVIEW );
}
int main(int argc, char **argv)
{
glutInit( &argc, argv );
glutInitDisplayMode( GLUT_SINGLE | GLUT_RGB );
glutInitWindowSize( 300, 300 );
glutInitWindowPosition( 100, 100 );
glutCreateWindow( "cubes" );
init();
glutDisplayFunc( display );
glutReshapeFunc( reshape );
glutMainLoop();
return 0;
}
发生错误啊
具体错误在附件中
我的qq642796608
谁会啊 教教我啊
谢谢了啊