关于c++的连接错误
我用deep exploration转换的.cpp源文件,连接时出错,哪位高手给看看!
/*
This file was produced by Deep Exploration Plugin: CPP Export filter.
Copyright (C) 1999-2008 Right Hemisphere
Mail support@righthemisphere.com for support.
Visit http://www.righthemisphere.com/dexp.htm for updates.
*/
#include <windows.h>
//#include <GL\gl.h>
//#include <GL\glu.h>
#include <glut.h>
struct sample_MATERIAL
{
GLfloat ambient[3];
GLfloat diffuse[3];
GLfloat specular[3];
GLfloat emission[3];
GLfloat alpha;
GLfloat phExp;
int texture;
};
static sample_MATERIAL materials [1] = {
{{0.117647f,0.117647f,0.117647f}, {0.796078f,0.823529f,0.937255f}, {0.150588f,0.150588f,0.150588f}, {0.0f,0.0f,0.0f}, 1.0f,8.0f,-1} //mat0
};
// 13 Verticies
// 0 Texture Coordinates
// 6 Normals
// 12 Triangles
static BYTE face_indicies[12][9] = {
// cube
{0,1,2 ,0,0,0 ,0,0,0}, {1,3,2 ,0,0,0 ,0,0,0}, {4,5,6 ,1,1,1 ,0,0,0},
{5,7,6 ,1,1,1 ,0,0,0}, {8,4,9 ,2,2,2 ,0,0,0}, {4,6,9 ,2,2,2 ,0,0,0},
{10,8,11 ,3,3,3 ,0,0,0}, {8,9,11 ,3,3,3 ,0,0,0}, {4,8,0 ,4,4,4 ,0,0,0},
{8,10,0 ,4,4,4 ,0,0,0}, {9,6,11 ,5,5,5 ,0,0,0}, {6,12,11 ,5,5,5 ,0,0,0}
};
static GLfloat vertices [13][3] = {
{0.5f,-0.5f,0.5f},{-0.5f,-0.5f,0.5f},{0.5f,-0.5f,-0.5f},
{-0.5f,-0.5f,-0.5f},{0.5f,0.5f,0.5f},{0.5f,-0.5f,0.5f},
{0.5f,0.5f,-0.5f},{0.5f,-0.5f,-0.5f},{-0.5f,0.5f,0.5f},
{-0.5f,0.5f,-0.5f},{-0.5f,-0.5f,0.5f},{-0.5f,-0.5f,-0.5f},
{0.5f,-0.5f,-0.5f}
};
static GLfloat normals [6][3] = {
{8.163e-018f,-1.0f,0.0f},{1.0f,1.15648e-016f,0.0f},{0.0f,1.0f,0.0f},
{-1.0f,0.0f,0.0f},{0.0f,0.0f,1.0f},{0.0f,0.0f,-1.0f}
};
GLfloat textures[1][2]={{0.0f,0.0f}};
/*Material indicies*/
/*{material index,face count}*/
static int material_ref [1][2] = {
{0,12}
};
void MyMaterial(GLenum mode, GLfloat * f, GLfloat alpha)
{
GLfloat d[4];
d[0] = f[0];
d[1] = f[1];
d[2] = f[2];
d[3] = alpha;
glMaterialfv(GL_FRONT_AND_BACK, mode, d);
}
/*
* SelectMaterial uses OpenGL commands to define facet colors.
*
* Returns:
* Nothing
*/
void SelectMaterial(int i)
{
//
// Define the reflective properties of the 3D Object faces.
//
glEnd();
GLfloat alpha = materials[i].alpha;
MyMaterial(GL_AMBIENT, materials[i].ambient, alpha);
MyMaterial(GL_DIFFUSE, materials[i].diffuse, alpha);
MyMaterial(GL_SPECULAR, materials[i].specular, alpha);
MyMaterial(GL_EMISSION, materials[i].emission, alpha);
glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, materials[i].phExp);
glBegin(GL_TRIANGLES);
};
GLint Gen3DObjectList()
{
int i;
int j;
GLint lid=glGenLists(1);
int mcount=0;
int mindex=0;
glNewList(lid, GL_COMPILE);
glBegin (GL_TRIANGLES);
for(i=0;i<sizeof(face_indicies)/sizeof(face_indicies[0]);i++)
{
if (!mcount)
{
SelectMaterial(material_ref[mindex][0]);
mcount = material_ref[mindex][1];
mindex ++;
}
mcount --;
for(j=0;j<3;j++)
{
int vi=face_indicies[i][j];
int ni=face_indicies[i][j+3];//Normal index
int ti=face_indicies[i][j+6];//Texture index
glNormal3f (normals[ni][0],normals[ni][1],normals[ni][2]);
glTexCoord2f(textures[ti][0],textures[ti][1]);
glVertex3f (vertices[vi][0],vertices[vi][1],vertices[vi][2]);
}
}
glEnd ();
glEndList();
return lid;
};