title: Link error adding geometry shader between vertex and fragment shader
body: <p>When I try adding a geometry shader between working vertex and fragment shaders I get a link error:</p>
  
  <pre><code>Fragment shader(s) failed to link,  vertex shader(s) failed to link. 
  ERROR: error(#280) Not all shaders have valid object code
  ERROR: error(#280) Not all shaders have valid object code
  </code></pre>
  
  <p>All three shaders compile without errors. I guess the in and outs doesn't fit in the information flow pipeline. The built-in ins and outs confuse me so I can't spot the error.</p>
  
  <p>Source for the shaders:</p>
  
  <pre><code>vertex_source =
      "#version 330\n"
      "in vec3 Position;\n"
      "in vec2 TexCoord;\n"
      "out vec3 oColor;\n"
      "out vec2 oTexcoord;\n"
      "void main() {\n"
      "    oTexcoord = TexCoord;\n"
      "    gl_Position = gl_ModelViewProjectionMatrix*vec4(Position, 1.0);\n"
      "}\n";
  
  geometry_source =
      "#version 330\n";
      "layout (triangles) in;\n";
      "layout (triangle_strip,  max_vertices=3) out;\n";
      "in vec3 Color;\n";
      "in vec2 TexCoord;\n";
      "out vec3 oColor;\n";
      "out vec2 oTexCoord;\n";
      "void main() {\n";
      "   oColor = Color;\n";
      "   oTexCoord = TexCoord;\n";
      "   gl_Position = gl_in[0].gl_Position;\n";
      "   EmitVertex();\n";
      "   gl_Position = gl_in[1].gl_Position;\n";
      "   EmitVertex();\n";
      "   gl_Position = gl_in[2].gl_Position;\n";
      "   EmitVertex();\n";
      "   EndPrimitive();\n";
      "}\n";
  
  fragment_source =
      "#version 330\n"
      "in vec2 oTexcoord;\n"
      "out vec4 oColor;\n"
      "uniform sampler2D tex;\n"
      "uniform sampler2D tex_norm;\n"
      "uniform sampler2D tex_spec;\n"
      "void main() {\n"
      "   vec4 lightpos = normalize(-gl_ModelViewProjectionMatrix*vec4(1.0, -1.0, -1.5, 1.0));\n"
      "   vec3 tmpNorm  = normalize(texture2D(tex_norm, oTexcoord).rgb * 2.0 - 1.0);\n"
      "   float a       = dot(tmpNorm, lightpos.xyz);\n"
      "   float difuse  = max(a, 0.1);\n"
      "   float spec    = texture2D(tex_spec, oTexcoord).r * pow(a, 2.0);\n"
      "   vec3 tmpcolor = difuse * texture2D(tex, oTexcoord).rgb;\n"
      "   oColor        = vec4(tmpcolor+tmpcolor*spec, 1.0);\n"
      "}\n";
  </code></pre>
  
  <p>What am I doing wrong in the geometry shader?</p>
  
  <p>I have tried skipping the unused oColor out and changed to an array in geometry shader like this:</p>
  
  <pre><code>#define GLSL(src) "#version 330 core\n" #src
  
  vertex_source = GLSL(
      in vec3 Position;
      in vec2 TexCoord;
      out vec2 oTexcoord;
      void main() {
          gl_Position = gl_ModelViewProjectionMatrix*vec4(Position, 1.0);
          oTexcoord = TexCoord;
      }
  );
  
  geometry_source = GLSL(
      layout (triangles) in;
      layout (triangle_strip,  max_vertices=3) out;
      in vec2 gsTexCoord[];
      out vec2 gsoTexCoord;
      void main() {
          gsoTexCoord = gsTexCoord[0];
          gl_Position = gl_in[0].gl_Position;
          EmitVertex();
          gsoTexCoord = gsTexCoord[1];
          gl_Position = gl_in[1].gl_Position;
          EmitVertex();
          gsoTexCoord = gsTexCoord[2];
          gl_Position = gl_in[2].gl_Position;
          EmitVertex();
          EndPrimitive();
      }
  );
  
  fragment_source = GLSL(
      in vec2 oTexcoord;
      out vec4 oColor;
      uniform sampler2D tex;
      uniform sampler2D tex_norm;
      uniform sampler2D tex_spec;
      void main() {
         vec4 lightpos = normalize(-gl_ModelViewProjectionMatrix*vec4(1.0, -1.0, -1.5, 1.0));
          vec3 tmpNorm  = normalize(texture2D(tex_norm, oTexcoord).rgb * 2.0 - 1.0);
         float a       = dot(tmpNorm, lightpos.xyz);
         float difuse  = max(a, 0.1);
         float spec    = texture2D(tex_spec, oTexcoord).r * pow(a, 2.0);
         vec3 tmpcolor = difuse * texture2D(tex, oTexcoord).rgb;
         oColor        = vec4(tmpcolor+tmpcolor*spec, 1.0);
      }
  );
  </code></pre>
  
  <p>That gives me the following link error:</p>
  
  <pre><code>Fragment shader(s) failed to link,  vertex shader(s) failed to link. 
  ERROR: error(#277) Symbol 'gsTexCoord[0]' usage doesn't match between two stages
  ERROR: error(#277) Symbol 'oTexcoord' usage doesn't match between two stages
  ERROR: error(#277) Symbol 'gsTexCoord[0]' usage doesn't match between two stages
  ERROR: error(#277) Symbol 'oTexcoord' usage doesn't match between two stages
  </code></pre>