PDA

View Full Version : Compilation error during program fragment shader



SagoO
04-03-2011, 02:13 AM
try3.c: In function ‘main’:
try3.c:223: error: stray ‘\342’ in program
try3.c:223: error: stray ‘\200’ in program
try3.c:223: error: stray ‘\235’ in program
try3.c:223: error: stray ‘\342’ in program
try3.c:223: error: stray ‘\200’ in program
try3.c:223: error: stray ‘\235’ in program
try3.c:223: error: ‘texture’ undeclared (first use in this function)
try3.c:223: error: (Each undeclared identifier is reported only once
try3.c:223: error: for each function it appears in.)



I got this error. I dun know what is this error. Please help.
Here is the code:



static GLhandleARB programObject; // the program used to update
static GLhandleARB fragmentShader;
static GLint location; // a parameter to the fragment program
.
.
.
.
// Create the fragment program
fragmentShader = glCreateShaderObjectARB(GL_FRAGMENT_SHADER_ARB);
glShaderSourceARB(fragmentShader,1,&fragment_sourc e,NULL);
glCompileShaderARB(fragmentShader);
glAttachObjectARB(programObject,fragmentShader);

// Link the shader into a complete GLSL program.
glLinkProgramARB(programObject);
glGetObjectParameterivARB(programObject,GL_OBJECT_ LINK_STATUS_ARB,&progLinkSuccess);
if (!progLinkSuccess){
fprintf(stderr, "Filter shader could not be linked\n");
exit(1);
}

// Get location of the sampler uniform
location = glGetUniformLocationARB(programObject, ”texture”);


And the error comes from line 223. Which is the glGetUniformLocationARB() functions there.

Anyone experience this error? Please help...

Alfonse Reinheart
04-03-2011, 02:22 AM


This is not an ASCII character 34 (aka: "). It is a Unicode character for a directional quotation mark. Unless your compiler is capable of compiling Unicode characters (or whatever character set you saved it in) in the particular encoding you saved it in, you'll get errors.

SagoO
04-03-2011, 04:50 AM


This is not an ASCII character 34 (aka: "). It is a Unicode character for a directional quotation mark. Unless your compiler is capable of compiling Unicode characters (or whatever character set you saved it in) in the particular encoding you saved it in, you'll get errors.

Okay.Thanks...=D