Jump to content
  • Advertisement
Sign in to follow this  
Steers

Errors, library problem?

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

Howdy yall, I get the following errors when trying to compile my program with textures. ------------------------------------------------------------- Linking... gltexture.obj : error LNK2001: unresolved external symbol __imp__glPopMatrix@0 gltexture.obj : error LNK2001: unresolved external symbol __imp__glEnd@0 gltexture.obj : error LNK2001: unresolved external symbol __imp__glVertex2d@16 gltexture.obj : error LNK2001: unresolved external symbol __imp__glTexCoord2d@16 gltexture.obj : error LNK2001: unresolved external symbol __imp__glBegin@4 gltexture.obj : error LNK2001: unresolved external symbol __imp__glRotatef@16 gltexture.obj : error LNK2001: unresolved external symbol __imp__glPushMatrix@0 gltexture.obj : error LNK2001: unresolved external symbol __imp__glBindTexture@8 gltexture.obj : error LNK2001: unresolved external symbol __imp__glEnable@4 gltexture.obj : error LNK2001: unresolved external symbol __imp__glClear@4 gltexture.obj : error LNK2001: unresolved external symbol __imp__glClearColor@16 gltexture.obj : error LNK2001: unresolved external symbol _gluBuild2DMipmaps@28 gltexture.obj : error LNK2001: unresolved external symbol __imp__glTexParameterf@12 gltexture.obj : error LNK2001: unresolved external symbol __imp__glTexEnvf@12 gltexture.obj : error LNK2001: unresolved external symbol __imp__glGenTextures@8 gltexture.obj : error LNK2001: unresolved external symbol __imp__glDeleteTextures@8 gltexture.obj : error LNK2001: unresolved external symbol __imp__wglMakeCurrent@8 gltexture.obj : error LNK2001: unresolved external symbol __imp__wglCreateContext@4 gltexture.obj : error LNK2001: unresolved external symbol __imp__wglDeleteContext@4 LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main Debug/gltexture.exe : fatal error LNK1120: 20 unresolved externals Error executing link.exe. -------------------------------------------------------------- I think i might need to include a specific library when using textures, but i'm not sure which one. If anyone recognizes these errors I would greatly appreciate some help. This was compiled with VC++.

Share this post


Link to post
Share on other sites
Advertisement
you need to include either <gl\gl.h>,<gl\glu.h>,<gl\glaux.h>. If you included those then you need to go into settings,link and add OpenGL32.lib GLu32.lib and GLaux.lib

Share this post


Link to post
Share on other sites
You need to link OpenGL32.lib and glu32.lib (glaux.lib not needed). You also need to compile as a Windows application, not a console application.

Enigma

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
The headers are obviously already included as the errors are of an external nature. Just add the opengl32 lib to the project workspace and you'll be fine.

Share this post


Link to post
Share on other sites
Thanks for the help yall, now i get only two errors. It may be because its a console app instead of a win32 app like Enigma said, however, i'm new to this and have no idea how to switch between the two?

my errors are...

Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/gltexture.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

Share this post


Link to post
Share on other sites
you should start a new window app. copy the code from the old file, paste it on the new file, delete the old file, and save the new file and your good.

Share this post


Link to post
Share on other sites
Woohoo, compiled 0 errors and 0 warnings, thanks yall. Only one problem now...The texture shows up as white instead of a texture...i don't think its the code, but i'll go back and check.

Share this post


Link to post
Share on other sites
The usual suspects:
  1. Do you have texturing enabled?

  2. Is your texture power-of-2 sized?

  3. Do you create your texture after obtaining a valid OpenGL context?

  4. Do you use mipmapped filtering? Do you create a texture with mipmaps?


Enigma

Share this post


Link to post
Share on other sites
Well, I downloaded this example to examine its source, and now i'm trying to recreate it. The texture came with the source. The only problem is that the workspace settings arent set, and i dont know what i need to set to make it work. The coordinates should be fine, the image rotates around the origin. It's just the image is all white and no texture lol.

I'll post some source, or send it to anyone if it would help, but i think the source isnt the problem.

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!