First things first, gl_VerticesIn
is only declared in GL_ARB_geometry_shader4
and geometry shaders are core in GLSL 3.30. There is no reason to even use the extension form of geometry shaders given your shader version, you are only making the GLSL compiler and linker's job more confusing by doing this.
Now, to actually solve your problem:
Rather than using gl_VerticesIn
, use gl_in.length ()
. It is really that simple.
And of course, it would also be a good idea to remove the redundant extension directive.