Hello,
I have a problem compiling
this GLSL example. The problematic lines are these:
Code:
/* The vertex shader */
char *vsSource = file2string("wave.vert");
char *fsSource = file2string("wave.frag");
/* Compile and load the program */
GLuint vs, /* Vertex Shader */
fs, /* Fragment Shader */
sp; /* Shader Program */
vs = glCreateShader(GL_VERTEX_SHADER);
glShaderSource(vs, 1, &vsSource, NULL);
glCompileShader(vs);
printLog(vs);
fs = glCreateShader(GL_FRAGMENT_SHADER);
glShaderSource(fs, 1, &fsSource, NULL);
glCompileShader(fs);
printLog(fs);
free(vsSource);
free(fsSource);
I get the error "invalid conversion from ‘char**’ to ‘const GLchar** {aka const char**}’ [-fpermissive]" for the lines where I call
glShaderSource(vs, 1, &vsSource, NULL);
and
glShaderSource(fs, 1, &fsSource, NULL);
Strangely it works if I change the first two lines to:
const char *vsSource = file2string("wave.vert");
const char *fsSource = file2string("wave.frag");
However I can't call free(vsSource) and free(fsSource) anymore if I do that