#Shader program failing to link

7 messages · Page 1 of 1 (latest)

untold dew
#

My shader program keeps failing to link.

This is my shader source code:

const char* vertexShaderSource =
"#version 440 core\n"
"layout (location = 0) in vec3 aPos;\n"
"void main() {\n"
"gl_Position = vec4(aPos.x, aPos.y, aPos.z, 1.0);\n"
"}\0";

const char* fragmentShaderSource =
"#version 440 core\n"
"out vec4 FragColor;\n"
"void main() {\n"
"FragColor = vec4(1.0f, 0.5f, 0.2f, 1.0f);\n"
"}\0";

const char* fragmentShaderSource2 =
"#version 440 core\n"
"out vec4 FragColor;\n"
"void main() {\n"
"FragColor = vec4(1.0f, 1.0f, 0.0f, 1.0f);\n"
"}\0";

This is where I compile and link(I have two separate shader programs - one for green and one for yellow fragment shaders): https://pastebin.com/zZgvgq4q

The yellow fragment shader compiles ok but the the yellowshaderprogram fails to link.

Pls let me know how to fix the issue.

tender basinBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

lethal bridge
#

Can you send the error that you're getting

untold dew
#

It doesn't really print out the info log; it only writes to the console the error message that I tell it to write which is

ERROR:SHADER:PROGRAM_YELLOW:COMPILATION_FAILD 
#

idk why infolog is not printing

untold dew
#

nvm i figured out the issue

#

!solved