title: OpenGL Cg Geometry Shader
body: <p>I'm getting a compiler error when trying to initialize a geometry shader using OpenGL.  I'm using VS2013.<br>
  Here is how I initialize it on OpenGL</p>
  
  <pre><code>myCgContext = cgCreateContext();
  cgGLSetDebugMode(CG_FALSE);
  
  cgSetParameterSettingMode(myCgContext, CG_DEFERRED_PARAMETER_SETTING);
  
  CGprofile gpProfile = cgGLGetLatestProfile(CG_GL_GEOMETRY);
  
  
  if (gpProfile == CG_PROFILE_UNKNOWN) {
      if (cgGLIsProfileSupported(CG_PROFILE_GLSLG))
          gpProfile = CG_PROFILE_GLSLG;
      else {
          fprintf(stderr, "%s: geometry profile is not available.\n", gpProfile);
          exit(0);
      }
  }
  
  
  cgGLSetOptimalOptions(gpProfile);
  OpenGLRenderer::checkForCgError("selecting geometry profile");
  
  CGprogram prog = cgCreateProgram(myCgContext, 
                                      CG_SOURCE, 
                                      "geometry_particles.cg",
                                      gpProfile, 
                                      "geometry_passthru",
                                      NULL);
  OpenGLRenderer::checkForCgError("Geometry program");
  </code></pre>
  
  <p>When I call the function checkForCgError, the compiler throws the following error message:
  The compiler returned an error. (1) : error C0000: syntax error, unexpected '.', expecting "::" at token '.'</p>
  
  <p>My geometry shader is located in the file "geometry_particles.cg" and the code is </p>
  
  <pre><code>// Geometry pass-through program for colored triangles
  void geometry_passthru(AttribArray&lt;float4&gt; position : POSITION, 
                      AttribArray&lt;float4&gt; color   : COLOR)
  {
      for (int i = 0; i &lt; 3; i++) 
      {
          emitVertex(position[i] :POSITION, color[i] : COLOR);
      }
  }
  </code></pre>
  
  <p>Any thoughts on why the compiler is throwing that error.  Am I missing a flag when setting up the shader?</p>