weird problem with gl_Position variable

Hello everybody.
Trying to compile the following simple vertex shader:

#version 150

in vec4 vPosition;
//in vec4 vColor;
uniform vec4 vColor;

uniform mat4 model_view;
uniform mat4 projection;

out vec4 color;

void main()
{
gl_Position = projectionmodel_viewvPosition;
color = vColor;
}

I’ve got the next error:

vshader.glsl failed to compile:
ERROR: 0:13: ‘gl_Position’ : undeclared identifier
ERROR: 0:13: ‘assign’ : cannot convert from ‘varying 4-component vector of floa
t’ to ‘float’

The funny thing is that the very same code works in anothet simple testing application I have…

Anybody knows what might be the problem?

Thanks you very much.

Heinrich

That might happen if you mistakenly try to compile vertex shader text as GL_FRAGMENT_SHADER.

Well, I don’t know why it happened for me, but when I moved the code out from some inner lass to an initalizing function it actually disappeared…
I dont’t know why but… let it be.
If anyone still has some explanation for me, I will thank hime very much…