我遇到两个错误,无法弄清楚如何解决,它们是:
错误 LNK2028:在函数“void __cdecl vox_texture_cube(unsigned int,unsigned int)”中引用了未解析的令牌 (0A0003A0)“void __cdecl polygon(int,int,int,int,unsigned int)”(?polygon@@$$FYAXHHHHI@Z) " (?vox_texture_cube@@$$FYAXII@Z)
错误 LNK2019:函数“void __cdecl vox_texture_cube(unsigned int,unsigned int)”中引用了无法解析的外部符号“void __cdecl polygon(int,int,int,int,unsigned int)”(?polygon@@$$FYAXHHHHI@Z) ?vox_texture_cube@@$$FYAXII@Z)
我唯一尝试过的是进入项目属性中的常规选项并将公共语言运行时支持更改为 /clr pure 根据此处的另一个问题,但是,这会导致更多问题。
这是我的代码:
//This Function creates a Polygon Face using Vertice Array
//It is the Method for creating each face of a cube
void **polgon**(int a, int b, int c, int d, GLuint texture)
{
glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, whiteSpecularMaterial);
glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, mShininess);
glBindTexture(GL_TEXTURE_2D, texture);
glBegin(GL_QUADS);
glTexCoord2f(0.0, 0.0);
glVertex3fv(vertices[a]);
glTexCoord2f(1.0, 0.0);
glVertex3fv(vertices[b]);
glTexCoord2f(1.0, 1.0);
glVertex3fv(vertices[c]);
glTexCoord2f(0.0, 1.0);
glVertex3fv(vertices[d]);
glEnd();
}