evovch
04-09-2012, 09:37 AM
Hello, everybody.
Searched in the net, many posts by no answer.
Trying to make the easiest programm get this error:
"Linker failure: Vertex shader(s) failed to link, no fragment shader(s) defined." or
"Linker failure: Vertex shader(s) failed to link, fragment shader(s) failed to link." depending on the configuration (frag shader off/on.
"ERROR: Not all shaders have valid object code.ERROR: Not all shaders have valid object code."
Both shaders do compile succesfully. Debugging shows that glLinkProgram fails.
Using MSVC++ 2010 under Win7.
Does anything depend on the harware? My graph card supports only version 3.2. Changing 1st line in shaders to
#version 320
does not help.
Vertex shader:
-----------------------------------------------------
#version 420
layout (location = 0) in vec4 in_Position;
layout (location = 1) in vec4 in_Color;
smooth out vec4 ex_Color;
void main()
{
gl_Position = in_Position;
ex_Color = in_Color;
}
-----------------------------------------------------
Fragment shader:
-----------------------------------------------------
#version 420
smooth in vec4 ex_Color;
out vec4 out_Color;
void main()
{
out_Color = ex_Color;
}
-----------------------------------------------------
Some parts from the source:
...
GLuint theProg;
...
std::vector<GLuint> shaderList;
shaderList.push_back(OvchCreateShader(GL_VERTEX_SH ADER, VertShaderFilename));
shaderList.push_back(OvchCreateShader(GL_FRAGMENT_ SHADER, FragShaderFilename));
theProg = OvchCreateProg(shaderList);
std::for_each(shaderList.begin(), shaderList.end(), glDeleteShader);
...
GLuint program = glCreateProgram();
for (size_t iLoop = 0; iLoop < shaderList.size(); iLoop++)
{ glAttachShader(program, shaderList[iLoop]); }
glLinkProgram(program);
...
Thank you! Any ideas?
Solved:
Stupid mistake - I did not send the shader's source to the glShaderSource inside my OvchCreateShader.
But now I get another problem.
ERROR: 0:1: '' : Version number not supported by GL2
ERROR: 0:3: 'layout' : syntax error parse error
ERROR: compilation errors. No code generated.
ERROR: 0:1: '' : Version number not supported by GL2
ERROR: 0:3: 'layout' : syntax error parse error
ERROR: compilation errors. No code generated.
ERROR: 0:1: '' : Version number not supported by GL2
ERROR: compilation errors. No code generated.
ERROR: 0:1: '' : Version number not supported by GL2
ERROR: compilation errors. No code generated.
Searched in the net, many posts by no answer.
Trying to make the easiest programm get this error:
"Linker failure: Vertex shader(s) failed to link, no fragment shader(s) defined." or
"Linker failure: Vertex shader(s) failed to link, fragment shader(s) failed to link." depending on the configuration (frag shader off/on.
"ERROR: Not all shaders have valid object code.ERROR: Not all shaders have valid object code."
Both shaders do compile succesfully. Debugging shows that glLinkProgram fails.
Using MSVC++ 2010 under Win7.
Does anything depend on the harware? My graph card supports only version 3.2. Changing 1st line in shaders to
#version 320
does not help.
Vertex shader:
-----------------------------------------------------
#version 420
layout (location = 0) in vec4 in_Position;
layout (location = 1) in vec4 in_Color;
smooth out vec4 ex_Color;
void main()
{
gl_Position = in_Position;
ex_Color = in_Color;
}
-----------------------------------------------------
Fragment shader:
-----------------------------------------------------
#version 420
smooth in vec4 ex_Color;
out vec4 out_Color;
void main()
{
out_Color = ex_Color;
}
-----------------------------------------------------
Some parts from the source:
...
GLuint theProg;
...
std::vector<GLuint> shaderList;
shaderList.push_back(OvchCreateShader(GL_VERTEX_SH ADER, VertShaderFilename));
shaderList.push_back(OvchCreateShader(GL_FRAGMENT_ SHADER, FragShaderFilename));
theProg = OvchCreateProg(shaderList);
std::for_each(shaderList.begin(), shaderList.end(), glDeleteShader);
...
GLuint program = glCreateProgram();
for (size_t iLoop = 0; iLoop < shaderList.size(); iLoop++)
{ glAttachShader(program, shaderList[iLoop]); }
glLinkProgram(program);
...
Thank you! Any ideas?
Solved:
Stupid mistake - I did not send the shader's source to the glShaderSource inside my OvchCreateShader.
But now I get another problem.
ERROR: 0:1: '' : Version number not supported by GL2
ERROR: 0:3: 'layout' : syntax error parse error
ERROR: compilation errors. No code generated.
ERROR: 0:1: '' : Version number not supported by GL2
ERROR: 0:3: 'layout' : syntax error parse error
ERROR: compilation errors. No code generated.
ERROR: 0:1: '' : Version number not supported by GL2
ERROR: compilation errors. No code generated.
ERROR: 0:1: '' : Version number not supported by GL2
ERROR: compilation errors. No code generated.