TGA and seg fault....

Hi,
I’m getting strange output - i load TGA,
do:
glGenTextures (1, &TextureArray[TextureID]);
glBindTexture (GL_TEXTURE_2D, TextureArray[TextureID]);

fprintf(stderr, "trying to bind texture

");
gluBuild2DMipmaps (GL_TEXTURE_2D, Type, Width, Height, Type, GL_UNSIGNED_BYTE, Data);
fprintf(stderr, "texture bound
");

and when prog gets to gluBuild2DMipmaps i receive
segmentation fault.
What can be wrong???
I use GLFW if that matters

Output the values of the parameters passed to gluBuildMipmaps and make sure they are valid.

Actually above happens under Linux,
under windows with bc++builder i don’t
have seg fault, but no texture at all.

You probably are passing invalid parameters to gluBuild2DMipmaps. Invalid parameters are probably handled differently in different libraries, which is why you get different results in linux and windows, but neither results in a valid texture.

I solved it…
it was because i called for gluBuild2DMipmaps
before initializing any OGL stuff…
I almost got my hair pulled out 'cause of this…