Jump to content
  • Advertisement
Sign in to follow this  
newbie2005

very easy question

This topic is 4858 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

hi, I'm using visual studio.net 2003. I've been downloading the visual studio.net tutorials from the site to learn, and they do work. But when I tried to create my own empty project and add the *.ccp file into the project, and build it. It gives me lots of errors to do with linkers.

Share this post


Link to post
Share on other sites
Advertisement
All the errors will appear in the form of:

error LNK2019: unresolved external symbol ...

Well heres the complete list anyway my project name is ox (naughts and cross):


ox fatal error LNK1120: 31 unresolved externals
ox error LNK2019: unresolved external symbol __imp__glBegin@4 referenced in function "int __cdecl DrawGLScene(void)" (?DrawGLScene@@YAHXZ)
ox error LNK2019: unresolved external symbol __imp__glBindTexture@8 referenced in function "int __cdecl LoadGLTextures(void)" (?LoadGLTextures@@YAHXZ)
ox error LNK2019: unresolved external symbol __imp__glBlendFunc@8 referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)
ox error LNK2019: unresolved external symbol __imp__glClear@4 referenced in function "int __cdecl DrawGLScene(void)" (?DrawGLScene@@YAHXZ)
ox error LNK2019: unresolved external symbol __imp__glClearColor@16 referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)
ox error LNK2019: unresolved external symbol __imp__glClearDepth@8 referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)
ox error LNK2019: unresolved external symbol __imp__glColor4f@16 referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)
ox error LNK2019: unresolved external symbol __imp__glDepthFunc@4 referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)
ox error LNK2019: unresolved external symbol __imp__glDisable@4 referenced in function _WinMain@16
ox error LNK2019: unresolved external symbol __imp__glEnable@4 referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)
ox error LNK2019: unresolved external symbol __imp__glEnd@0 referenced in function "int __cdecl DrawGLScene(void)" (?DrawGLScene@@YAHXZ)
ox error LNK2019: unresolved external symbol __imp__glGenTextures@8 referenced in function "int __cdecl LoadGLTextures(void)" (?LoadGLTextures@@YAHXZ)
ox error LNK2019: unresolved external symbol __imp__glHint@8 referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)
ox error LNK2019: unresolved external symbol __imp__glLightfv@12 referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)
ox error LNK2019: unresolved external symbol __imp__glLoadIdentity@0 referenced in function "void __cdecl ReSizeGLScene(int,int)" (?ReSizeGLScene@@YAXHH@Z)
ox error LNK2019: unresolved external symbol __imp__glMatrixMode@4 referenced in function "void __cdecl ReSizeGLScene(int,int)" (?ReSizeGLScene@@YAXHH@Z)
ox error LNK2019: unresolved external symbol __imp__glNormal3f@12 referenced in function "int __cdecl DrawGLScene(void)" (?DrawGLScene@@YAHXZ)
ox error LNK2019: unresolved external symbol __imp__glRotatef@16 referenced in function "int __cdecl DrawGLScene(void)" (?DrawGLScene@@YAHXZ)
ox error LNK2019: unresolved external symbol __imp__glShadeModel@4 referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)
ox error LNK2019: unresolved external symbol __imp__glTexCoord2f@8 referenced in function "int __cdecl DrawGLScene(void)" (?DrawGLScene@@YAHXZ)
ox error LNK2019: unresolved external symbol __imp__glTexImage2D@36 referenced in function "int __cdecl LoadGLTextures(void)" (?LoadGLTextures@@YAHXZ)
ox error LNK2019: unresolved external symbol __imp__glTexParameteri@12 referenced in function "int __cdecl LoadGLTextures(void)" (?LoadGLTextures@@YAHXZ)
ox error LNK2019: unresolved external symbol __imp__glTranslatef@12 referenced in function "int __cdecl DrawGLScene(void)" (?DrawGLScene@@YAHXZ)
ox error LNK2019: unresolved external symbol __imp__glVertex3f@12 referenced in function "int __cdecl DrawGLScene(void)" (?DrawGLScene@@YAHXZ)
ox error LNK2019: unresolved external symbol __imp__glViewport@16 referenced in function "void __cdecl ReSizeGLScene(int,int)" (?ReSizeGLScene@@YAXHH@Z)
ox error LNK2019: unresolved external symbol __imp__wglCreateContext@4 referenced in function "int __cdecl CreateGLWindow(char *,int,int,int,bool)" (?CreateGLWindow@@YAHPADHHH_N@Z)
ox error LNK2019: unresolved external symbol __imp__wglDeleteContext@4 referenced in function "void __cdecl KillGLWindow(void)" (?KillGLWindow@@YAXXZ)
ox error LNK2019: unresolved external symbol __imp__wglMakeCurrent@8 referenced in function "void __cdecl KillGLWindow(void)" (?KillGLWindow@@YAXXZ)
ox error LNK2019: unresolved external symbol _auxDIBImageLoadA@4 referenced in function "struct _AUX_RGBImageRec * __cdecl LoadBMP(char *)" (?LoadBMP@@YAPAU_AUX_RGBImageRec@@PAD@Z)
ox error LNK2019: unresolved external symbol _gluBuild2DMipmaps@28 referenced in function "int __cdecl LoadGLTextures(void)" (?LoadGLTextures@@YAHXZ)
ox error LNK2019: unresolved external symbol _gluPerspective@32 referenced in function "void __cdecl ReSizeGLScene(int,int)" (?ReSizeGLScene@@YAXHH@Z)

Share this post


Link to post
Share on other sites
Make sure you include the opengl32.lib and glu32.lib files in your project (Project -> <your project name> Properties -> Linker -> Input and then the Additional Dependencies).

EDIT: those linker errors notify you that the linker can not find those functions. This happens when you are not linking to particular library files (collections of functions), in this case the opengl32.lib and glu32.lib libraries. When you changed your project as described above, recompile your program and these linker errors should disappear.

Share this post


Link to post
Share on other sites
Thanks alot for that.

Just 1 quick question, does that mean I have to include all the libraries I use inside that dependency box? I thought the #include header does that.

Share this post


Link to post
Share on other sites
Quote:
Original post by newbie2005
Thanks alot for that.

Just 1 quick question, does that mean I have to include all the libraries I use inside that dependency box? I thought the #include header does that.
All #include does is include the declarations, you need to add a linker option to link with the object/library file(s) which contain the definitions.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!