#Shader program failing to link on opengl

7 messages · Page 1 of 1 (latest)

frosty thistle
#

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.

drifting mossBOT
#

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.

silver fox
#

Post this in #1013107104678162544 instead

frosty thistle
#

woops sorry

#

didnt realize

silver fox
#

All good

frosty thistle
#

!solved