unresolved externals
Hey guys me again,
i need to know what this means, ill give you tyhe code to to help.
/*
This file was produced by 3D Exploration Plugin: CPP Export filter.
3D Exploration
Copyright (c) 1999-2000 X Dimension Software
WWW http://www.xdsoft.com/explorer/
eMail info@xdsoft.com
*/
#include <windows.h>
#include <gl.h>
#include <glu.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.752941f,0.752941f,0.752941f}, {0.752941f,0.752941f,0.752941f}, {0.0f,0.0f,0.0f}, 1.0f,8.0f,-1} //Explorer Default
};
// 8 Verticies
// 8 Texture Coordinates
// 8 Normals
// 12 Triangles
static BYTE face_indicies[12][9] = {
// Box01
{2,3,0 ,0,1,2 ,0,1,2 }, {1,0,3 ,3,2,1 ,3,2,1 }, {5,7,4 ,4,5,6 ,4,5,6 },
{6,4,7 ,7,6,5 ,7,6,5 }, {1,5,0 ,3,4,2 ,3,4,2 }, {4,0,5 ,6,2,4 ,6,2,4 },
{3,7,1 ,1,5,3 ,1,5,3 }, {5,1,7 ,4,3,5 ,4,3,5 }, {2,6,3 ,0,7,1 ,0,7,1 },
{7,3,6 ,5,1,7 ,5,1,7 }, {0,4,2 ,2,6,0 ,2,6,0 }, {6,2,4 ,7,0,6 ,7,0,6 }
};
static GLfloat vertices [8][3] = {
{-0.175528f,-0.5f,-0.263674f},{0.175528f,-0.5f,-0.263674f},{-0.175528f,0.5f,-0.263674f},
{0.175528f,0.5f,-0.263674f},{-0.175528f,-0.5f,0.263674f},{0.175528f,-0.5f,0.263674f},
{-0.175528f,0.5f,0.263674f},{0.175528f,0.5f,0.263674f}
};
static GLfloat normals [8][3] = {
{-0.816497f,0.408248f,-0.408248f},{0.333333f,0.666667f,-0.666667f},{-0.333333f,-0.666667f,-0.666667f},
{0.816497f,-0.408248f,-0.408248f},{0.408248f,-0.816497f,0.408248f},{0.666667f,0.333333f,0.666667f},
{-0.666667f,-0.333333f,0.666667f},{-0.408248f,0.816497f,0.408248f}
};
static GLfloat textures [8][2] = {
{0.303775f,0.5f},{0.196225f,0.5f},{0.696225f,0.5f},
{0.803775f,0.5f},{0.803775f,0.102329f},{0.196225f,0.102329f},
{0.696225f,0.102329f},{0.303775f,0.102329f}
};
/*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.alpha;
MyMaterial (GL_AMBIENT, materials.ambient,alpha);
MyMaterial (GL_DIFFUSE, materials.diffuse,alpha);
MyMaterial (GL_SPECULAR, materials.specular,alpha);
MyMaterial (GL_EMISSION, materials.emission,alpha);
glMaterialf (GL_FRONT_AND_BACK,GL_SHININESS,materials.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[j];
int ni=face_indicies[j+3];//Normal index
int ti=face_indicies[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;
};
This is a exploration export from md3 to .cpp opengl source code.
I build this and receive the following error:
opengl2 error LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup
I got the feeling this is gonna make me look like a newbie(which i am<img src="smile.gif" width=15 height=15 align=middle> but what does this mean?
</i>
Where have you lost your main void? :-)
Is this all your code?
Corrail
corrail@gmx.at
ICQ#59184081
[edited by - Corrail on July 28, 2003 1:10:14 PM]
Is this all your code?
Corrail
corrail@gmx.at
ICQ#59184081
[edited by - Corrail on July 28, 2003 1:10:14 PM]
--------------------------------------------------------There is a theory which states that if ever anybody discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable.There is another theory which states that this has already happened...
This is not a full C/C++ program. That is, this code only defines functions, variables and structures. All C/C++ programs have a function called main from which the compiled program begins executing. You need a function called:
void main()
or
int WINAPI WinMain(...)
in-order for the program to compile and run properly.
My advice, get a good C/C++ book. Personally I recommend the "K&R" book. (Forgot the full name. Too late in the night to think through.)
Or better yet C/C++ for Dummies. Read through the book and loved it. Still keep it around.
The best is yet to be
void main()
or
int WINAPI WinMain(...)
in-order for the program to compile and run properly.
My advice, get a good C/C++ book. Personally I recommend the "K&R" book. (Forgot the full name. Too late in the night to think through.)
Or better yet C/C++ for Dummies. Read through the book and loved it. Still keep it around.
The best is yet to be
The best is yet to be
Well that did it, there is supposed to be a box in the veiwport.
i apllied:
void main()
{}
and it compiled correctlly, i ran it and it gave me nothing.
I think i need to add a window am i correct?
i apllied:
void main()
{}
and it compiled correctlly, i ran it and it gave me nothing.
I think i need to add a window am i correct?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement