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

01-06-2012, 09:51 PM

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 http://www.khronos.org/files/opengles_s ... nguage.pdf (http://www.khronos.org/files/opengles_shading_language.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

01-06-2012, 10:22 PM
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)!

01-09-2012, 05:44 AM
The function main is used as the entry point to a shader. Both the vertex shader and fragment shader must contain a function named main.
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.