GLSL Linking Errors

what are generally the errors that can produce a linking error with a shader program ?

I have created my main.cpp programm in addition
of the shader class in a header file plus
the two separated files of fragment and
vertex shaders but I am getting a white triangle and a

Definition for void main() not found

is that problem related to my code or to the the path of the shaders files ?

Please be sure to read the Forum Posting Guidelines, and include code samples with a details list of things you have done to try and fix the problem.

There are quite a few. It’s not unlike linking your C++ program.

Some reasons are listed here: Shader_Compilation#Program_linking. These aren’t all of them however.

I tweaked the markup in your post to highlight this error message (it wasn’t obvious that it was there before).

This sounds like an error that occurred when compiling one of your shaders (either vertex or fragment shader in your case). They each need their own main() routine.

If one of them failed to compile (as this error message suggests), then as you’d expect, you definitely can’t link them together successfully into a program.

Re forum markup, see this page for tips. For blocks of code and error messages, see this section: this section. Update: Here’s another quick ref (better for fast reference): Markdown reference.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.