Shaders & programsGL 2.0

glGetProgramInfoLog

Reads the linker's error and warning messages for a program.

Part of the family glGet*

Signature

void glGetProgramInfoLog(GLuint program, GLsizei maxLength,
                         GLsizei *length, GLchar *infoLog);

How it works

Typical link errors: a varying declared out in the vertex shader but misspelled as in in the fragment shader, or a missing main() in one stage.

Parameters

programGLuint

Program whose log to read.

maxLengthGLsizei

Size of your buffer.

lengthGLsizei *

Receives the characters written (optional).

infoLogGLchar *

Buffer that receives the text.

Example

example.cpp
1char log[1024];
2glGetProgramInfoLog(program, sizeof(log), nullptr, log);
Official Khronos documentation