"No definition of main in vertex shader" during OpenGL Program link status check
<p>I am writing an OpenGL / C++ plugin using VBO and GLSL shaders. However, while I can compile the shaders successfully, and link them to the program, its status link check with <code>glGetProgramiv(...,GL_LINK_STATUS,...)</code> returns a "No definition of main in vertex shader" error.<P>
The vertex shader is sending a color to the fragment shader. If I remove this color-passing, the link is successfully validated.<P>
What's wrong in my code if I want to pass color to fragment shader ?</p>

<pre><code>    const GLchar *vert_src =
    "#version 410\n"
    "layout (location = 0) in vec3 Pos;\n"
    "layout (location = 1) in vec3 vColor;\n"
    "uniform mat4 projectionMatrix;\n"
    "uniform mat4 modelViewMatrix;\n"
    "out vec3 color;\n";  // -&gt; REMOVING THIS LINE MAKES THE VALIDATION WORK
    "void main() {\n"
    "   color=vColor;\n" // -&gt; AND THIS LINE TOO 
    "   gl_Position = projectionMatrix*modelViewMatrix*vec4(Pos.x, Pos.y, Pos.z, 1.0);"
    "}\n";

    const GLchar *frag_src =
    "#version 410\n"
    "in vec3 color;\n";
    "out vec4 fragColor;\n"
    "void main() {\n"
     "   fragColor = vec4(color, 1.0);"
     "}\n";

    GLuint program = glCreateProgram();

    GLuint v_shader = glCreateShader(GL_VERTEX_SHADER);
    GLuint f_shader = glCreateShader(GL_FRAGMENT_SHADER);
    int len=(GLint)strlen(vert_src);
    glShaderSource(v_shader, 1, &amp;vert_src, &amp;len);
    glCompileShader(v_shader);

    glGetShaderiv(v_shader, GL_COMPILE_STATUS, &amp;success); --&gt; SUCCESS

    len=(GLint)strlen(frag_src);
    glShaderSource(f_shader, 1, &amp;frag_src, &amp;len);
    glCompileShader(f_shader);

    glGetShaderiv(f_shader, GL_COMPILE_STATUS, &amp;success); --&gt; SUCCESS

    glAttachShader(program, v_shader);  --&gt; SUCCESS
    glAttachShader(program, f_shader);  --&gt; SUCCESS

    glLinkProgram(program);   --&gt; SUCCESS

    glValidateProgram(program);     --&gt; SUCCESS
    glGetProgramiv(program, GL_LINK_STATUS, &amp;success); --&gt; ERROR: Program is not successfully linked
[...] rest of code
</code></pre>