These are a few common problems that cause people no small amount of consternation. If you have suggestions for things to be added to this list, please send them to me.
find . -name "*.o" -exec rm {} \; find . -name "*.so" -exec rm {} \;(Some people add a "clean" target to their Makefile that does this.) Situations under which this may be required include:
#version 420 core in vec2 mcPosition; uniform vec4 scaleTrans; void main() { gl_Position = vec4(0, 0, 0, 1); }
Even if you use them like:
#version 420 core in vec2 mcPosition; uniform vec4 scaleTrans; void main() { float ldsX = scaleTrans[0]*mcPosition.x + scaleTrans[1]; float ldsY = scaleTrans[2]*mcPosition.y + scaleTrans[3]; gl_Position = vec4(0, 0, 0, 1); }the result will be the same because GLSL is so clever that it says "Hey, even though you actually used scaleTrans, it didn't actually affect the program (because the results did not get passed on), so I am not going to allocate storage for it." (The error message for mcPosition does not always appear in this variation.)
#version 420 core in float somePerVertexVariable; out float somePerVertexVariableToFS; void main() { somePerVertexVariableToFS = somePerVertexVariable; … }Fragment shader:
#version 420 core in int somePerVertexVariableToFS; // uh-oh - should have been "float" void main() { … }The program will compile and run without generating errors, but your variable (somePerVertexVariableToFS) will most likely have an unexpected value.