I have this a bit and I canβt understand what is wrong. My shader:
This shader that I know works, but when I try to link the program, I get:
glLinkProgram:Vertex info ----------- 0(3) : error C1013: function "main" is already defined at 0(4)
I checked to make sure that viles get into memory correctly and what not. they just compile. itβs a binding step that something went wrong. I do not know that, and for quite some time I hit my head about it. any advice?
Edit:
Here is the code that I use to create the shader. it comes to the conditional, it actually completes the whole execution, but the journal prints what you saw above.
GLuint updateProg() { prog = glCreateProgram(); if (vs == 0 || fs == 0) return 0; glAttachShader(prog, vs); glAttachShader(prog, fs); int link_ok; glLinkProgram(prog); glGetProgramiv(prog, GL_LINK_STATUS, &link_ok); if (!link_ok) { fprintf(stderr, "glLinkProgram:"); print_log(prog); return 0; } return prog; }
source share