Problems with glGenTextures

When i try to generate a texture object with glGenTextures i do not get any identifier back.
What am i doing wrong and how can i solve this problem?

Well, you don’t give much information, except that something is wrong. Please tell us more, how do you use it for example?

Additional info:
This is an extraction from my source code:

void World::addtexture(String id)
{
int n;
bool loaded=false;
Texture *tex;
GLuint index;

for(n=0;n<num_textures;n++)
	if(id==texturestore[n]->ID) loaded=true;
if(!loaded)
{
	BMPFile	handle;
	tex=handle.load(id.text);
	texturestore[num_textures]=tex;
	tex->idnum=num_textures;
	glGenTextures(1,&index);
	glBindTexture(GL_TEXTURE_2D,index);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);

	glTexImage2D(GL_TEXTURE_2D,0,3,tex->width,tex >height,0,GL_RGB,GL_UNSIGNED_BYTE,tex->data);
	num_textures++;
}

}

In this source I do not get any identifier (index) for the texture object I wanted, therefore I believe that it was not created.
I have looked at an example that uses glGenTextures and it worked, therefore I started to remove code from it to see if the same problem occurred there as in my code.
And indeed it did.
But when the glutCreateWindow() function was executed it started to work again. I’m confused.
I haven’t found any good documentation on glGenTextures and if there should be any premises and constraints to make it work.
I have also thought about if errors reported by OpenGL affects the functionality of certain functions, and if this is the case with my problem?

glutCreateWindow does not only creates a window on the screen. It also creates an OpenGL rendering context, which is a requirement for OpenGL to work at all. If you remove that function, a context will not be created, and no calls to OpenGL will work as expected.

As long as you create a context before doing anything else, there should be no problem with your code. You can do some error checking after glGenTexture. If index is zero, no texture was allocated, otherwise a texture was properly allocated.

Thanks for the help, could been lost out there for ages without your help

Now it works as it should.