OpenGL GLSL compilation problem

Hello! I am currently experiencing errors while trying to compile a GLSL shader, the problem is that i KNOW that the GLSL shader code is correct and working, however the compiler still gives me errors.

Here is the error i get:
1
2
3
Vertex shader failed to compile with the following errors:
ERROR: 0:12: error(#132) Syntax error: "<" parse error
ERROR: error(#273) 1 compilation errors. No code generated 


And here is the GLSL shader code:
1
2
3
4
5
6
7
8
9
10
11
12
#version 330

layout(location = 0)in vec4 vert;

uniform mat4 projection;
uniform mat4 view;
uniform mat4 model;

void main()
{
    gl_Position = projection * view * model * vert;
}


I am using version 3.3 of OpenGL through SFML 2.0, i specify this through:
1
2
3
4
5
6
  	sf::ContextSettings settings;
	settings.depthBits = 24;
	settings.stencilBits = 8;
	settings.antialiasingLevel = AA;
	settings.majorVersion = 3;
	settings.minorVersion = 3;
Ok there seemed to be the problem that i forgot to add the NULL termination at the end of the file. But now i am getting linker errors, but the log outputs nothing this time :S

Here is the fragment shader too:
1
2
3
4
5
6
7
8
#version 330

out vec4 fragColor;

void main()
{
    fragColor = vec4(1.0, 0.0, 0.0, 1.0);
}
Last edited on
*bump*
But now i am getting linker errors, but the log outputs nothing this time


No point in bumping if you're not going to enumerate the errors you're getting. We aren't looking over your shoulder.
The only error output i get is some garbled info, looks like this: [|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[||[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[||[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[||[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[||[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[||[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[||[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[||[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[||[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[||[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[||[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[|[||[|[|

I fixed it. The problem was that i FORGOT to add this line before linking the program:
program = glCreateProgram();
Last edited on
Topic archived. No new replies allowed.