Jump to content
  • Advertisement

Archived

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

CoMpFreaK

Whats This?

This topic is 5534 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

What does this mean? opengl2 error LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup here is the code: /* 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

Share this post


Link to post
Share on other sites
Advertisement
It means there''s no main function defined which you need for your program to compile and run properly.

Share this post


Link to post
Share on other sites
quote:
Original post by CoMpFreaK
What does this mean?

opengl2 error LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup


Are you using Visual C++? What project type?

If you select an empty project for Win32 Application Project Type and do not define a WinMain, you will get this error.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Where''s your main/WinMain function?
Are you trying to make an executable, or a dll?

Share this post


Link to post
Share on other sites
its a win 32 apllication,
i can put a:


void main()
{}

at the beggining and it compiles correctly.
problem is when i run it it shows a blank screen.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!