hi
written in VC++ as a simple text application. it is to load abmp image in opengl. it gives the following errors:
--------------------Configuration: main - Win32 Debug--------------------
Linking…
main.obj : error LNK2001: unresolved external symbol _auxDIBImageLoadA@4
Debug/main.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
main.exe - 2 error(s), 0 warning(s)
here is the code:
#include<stdio.h>
#include<GL/glaux.h>
#include<GL/glut.h>
#include<windows.h>
void init(void)
{
glClearColor(0.0,0.0,0.0,0.0);
}
void display(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glFlush();
}
void reshape(int w, int h)
{
glViewport(0,0,(GLsizei) w,(GLsizei) h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(50.0,50.0,-50.0,-50.0,-1.0,1.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
GLuint LoadGLTexture(char *filename,int filter) // Load Bitmaps And Convert To Textures
{
GLuint tempadd; // Storage for one texture
AUX_RGBImageRec *TextureImage[1]; // Create Storage Space For The Texture
memset(TextureImage,0,sizeof(void *)*1); // Set The Pointer To NULL
if (filter > 2) //Invaild filter
{
exit(1);
}
if (TextureImage[0]==auxDIBImageLoad(filename))
{
glGenTextures(1, &tempadd); //Setup storage
glBindTexture(GL_TEXTURE_2D, tempadd);
if (filter==0)
{
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
glTexImage2D(GL_TEXTURE_2D, 0, 3, TextureImage[0]->sizeX, TextureImage[0]->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, TextureImage[0]->data);
}
if (filter==1)
{
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
glTexImage2D(GL_TEXTURE_2D, 0, 3, TextureImage[0]->sizeX, TextureImage[0]->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, TextureImage[0]->data);
}
if (filter==2)
{
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
gluBuild2DMipmaps(GL_TEXTURE_2D, 3, TextureImage[0]->sizeX, TextureImage[0]->sizeY, GL_RGB, GL_UNSIGNED_BYTE, TextureImage[0]->data);
}
if (TextureImage[0]) // If Texture Exists
{
if (TextureImage[0]->data) // If Texture Image Exists
free(TextureImage[0]->data); // Free The Texture Image Memory
free(TextureImage[0]); // Free The Image Structure
}
}
return tempadd; // Return The Texture Structure
}
int main(int argc,char **argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB);
glutInitWindowSize(500,500);
glutInitWindowPosition(100,100);
glutCreateWindow(“Spiderman”);
init();
glutDisplayFunc(display);
glutReshapeFunc(reshape);
GLuint newtex;
newtex = LoadGLTexture(“bubbles.bmp”,2);
glBindTexture(GL_TEXTURE_2D,newtex);
glutMainLoop();
return 0;
}
thanks a lot in advance!!!
anxious yet again