Reputation: 111
this is the error I get when my application starts:
Vertex shader(s) failed to link, fragment shader(s) failed to link.
Vertex link error: INVALID_OPERATION.
ERROR: error(#97) No program main found
fragment link error: INVALID_OPERATION.
ERROR: error(#97) No program main found
I couldn't find any mistake, but the shaders are correctly (fully) loaded and compiled without any errors. Here are my shaders:
vertex shader:
#version 330
layout (location = 0) in vec3 position;
void main()
{
gl_Position = vec4(position, 1.0);
}
fragment shader:
#version 330
out vec4 outputColor;
void main()
{
outputColor = vec4(1.0, 0.5, 0.2, 1.0);
}
Upvotes: 4
Views: 3957
Reputation: 1824
Errors like these are usually caused by glShaderSource
not receiving a correct source code string.
The cause of your issue is most likely that your shader code wasn't loaded properly and an incorrect string (or char array) is passed to glShaderSource
Upvotes: 5