bool getCompileResult(unsigned int *shader, const char *src) { glShaderSource(*shader, 1, &src, nullptr); //the error is in glShaderSource! (error is GL_INVALID_VALUE) //etc....}const char *vertexShaderSource = "#version 330 core\n""layout (location = 0) in vec3 aPos;\n""void main()\n""{\n"" gl_Position = vec4(aPos.x, aPos.y, aPos.z, 1.0);\n""}\0";int main() { //some stuff unsigned int vertexShader = glCreateShader(GL_VERTEX_SHADER); if(!getCompileResult(&vertexShader, vertexShaderSource)) return -1;}