G.M. found the solution in the comments, and as BDL elaborated, the problem was that I used glew instead of glad in the shader source file.