Compile: "ERROR: Missing main()" but spec says linking L0009


Sorry about the subject, couldn’t fit all of the description. The problem i’m having is that i get the error “ERROR: Missing main()” when i’m trying to compile one of the shader objects . It doesn’t have a main because it’s a library that i add to my program along with other shader objects that do have main functions.

My idea was that GLES might not support this as OpenGL does, but according to the shader specs at … nguage.pdf there is a link error “L0009: Missing main function for shader.” and no compile error defined.

I’m running WebGL but i thought it was more relevant to GLES as it is a shader issue.

The computer is running Ubuntu 11.04 something, and glxinfo gives:

OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: Quadro FX 1600M/PCI/SSE2
OpenGL version string: 3.3.0 NVIDIA 290.10
OpenGL shading language version string: 3.30 NVIDIA via Cg compiler

I’m running Chrome 17.0.963.26 dev

Thanks in advance

Hmm, i guess that when i think about it it makes sense. Since the GLES GLSL does not support branching as i’ve understood it’s logic that it doesn’t allow libraries as shader objects because there would be no way of calling them…

But it’s still weird that the spec says it’s a linker error (as it would be in OpenGL non-ES though)!

OpenGL ES 2.0 does not support linking of multiple shader objects for the same shader stage. Thus a shader object without main would be of no use.

GLSL ES does support branching and function calls.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.