I am a C# .NET programmer who has recently switched to c++, and thus my understanding on some things could be a little fuzzy...
i am attempting to create a static STL map for the purpose of keeping track of which textures i have already loaded into video memory. It needs to store a string, and a GLuint, and after reading some things i managed to get that working, but when i tried to make it a static member of my texture loading class, everything goes haywire... so here is my code, and my error, any help would be greatly appreciated...
code for LoadTexture (this is where the error occurs i think) :
GLuint TextureLoader::LoadTexture(std::string filename)
{
Texture tex; //create Texture structure to load into
GLuint texID; //greate ID for texture once loaded in OpenGL
if(LoadTGA(&tex, filename.c_str())) //Try to load texture from file, if sccuessful, load into OpenGl
{
glGenTextures(1, &texID);
glBindTexture(GL_TEXTURE_2D, texID);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);
glTexImage2D(GL_TEXTURE_2D, 0, 4, tex.width, tex.height, 0, tex.type, GL_UNSIGNED_BYTE, tex.imageData);
}
free(tex.imageData);
textures[filename] = texID;
return texID; //return OpenGl Texture ID so that we can use it
} All the code compiles fine, and the application launches, but then i get this:
ZeroLink: unknown symbol '__ZN13TextureLoader8texturesE'
SimpleGame has exited due to signal 6 (SIGABRT).
Again, my "c++-fu" is very weak so this could be something very simple... Thanks for taking the time to read!!
Could you isolate the bug enough to create a compilable module of code with a main and everything necessary to build in the VC++ IDE with the following headers?