Problem loading BMP textures

Started by
5 comments, last by Vindicator 19 years, 2 months ago
Hi everyone! I have just started learning OpenGL, and am trying to make a simple solar system work. Earlier, I used ppm files for the textures of the planets, but I changed to BMP, using some of the functions i found in an OpenGL tutorial here on gamedev.net. it can be compiled, but when when trying to execute the program, I just get those two error messages all the time: "--------------------Configuration: solsystem - Win32 Debug-------------------- Linking... solsystem.obj : error LNK2001: unresolved external symbol _auxDIBImageLoadA@4 Debug/solsystem.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. solsystem.exe - 2 error(s), 0 warning(s)" and I have no idea what to do. :/ Therefore, I just wanted to ask if any of you people in here had any suggestions? I think I might be doing something wrong at the beginning of main, at the lines "AUX_RGBImageRec *TextureImage[1]; memset(TextureImage,0,sizeof(void *)*1); TextureImage[0] = LoadBMP("Data/test4.bmp");", but I am not sure. Here is the code of what I´ve done so far (my comments are in swedish, but I hope the code is understandable anyway, since it´s not very complicated): (have removed the code since I changed it completely. :) ). [Edited by - Vindicator on February 8, 2005 8:27:45 AM]
Advertisement
GLaux is depreciated, and buggy as hell, so I wouldn't use it if I were you. Try DevIL for image loading if you want to use a library, or alternatively write your own BMP loader.
If at first you don't succeed, redefine success.
... but, since glaux is still part of the Windows SDK, you may want to use it. If you need to correct this error, simply link with the glaux.lib library. If you are using VC++ (looks like) it is simple as hell: add the following line under the #include:

#pragma comment(lib, "glaux.lib")


It should work.

You can also add glaux.lib to the library list (project options, where you already added opengl32.lib).

HTH,
I already changed to loading the textures from TGA files instead (which was a lot easier), since I didn´t think there was any way to solve the problem. But thanks for helping me anyway. :)
I think it should be easier to load textures in OpenGL than this... have had a lot of problems with it (both when testing with ppm files and bmp) before it finally worked.
Quote:Original post by Vindicator
...I think it should be easier to load textures in OpenGL than this...


Well, the actual creation of textures is very simple, you're basically just sending an array to the video card. The "hard" part is the loading of the image, which really has nothing to do with the 3D API. And once you understand the file format, it's very simple to write an image loader anyway if you understand file I/O.

But congrats on the TGA loader, I know your first file loader can be somewhat confusing. Plus, TGAs are more useful than BMPs because they support an alpha channel.

EDIT: Forgot this wasn't the OpenGL forum for a second.
Quote:Original post by Vindicator
since I didn´t think there was any way to solve the problem.

Thanks for your confidence. Did you read what I wrote?
Yup, I did. =) I meant that I thought there wasn´t any way to solve it, before you posted above... not after that.

I had saved an old copy of the code which I added that line to, so then the linking worked. It didn´t crash until I tried running the program that time, instead of when I built it. =) And with the other version where I use TGA pictures, I don´t get any errors or crashes at all. =D

This topic is closed to new replies.

Advertisement