Archived

This topic is now archived and is closed to further replies.

CoMpFreaK

unresolved externals

Recommended Posts

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[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 but what does this mean?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites