Basic Shader Problem

I’m trying to learn how to use shaders next, but I keep hitting an error. I’ve kept my code simple:

        vert = """
//GLSL
#version 120

attribute vec4 p3d_Vertex;
uniform mat4 p3d_ModelViewProjectionMatrix;

void vshader()
{
  gl_Position = p3d_ModelViewProjectionMatrix * p3d_Vertex;
}
        """

        frag = """
#version 120

void shader()
{
  gl_FragColor = vec4(1, 1, 0, 1);
}        
        
        """
        box_file = self.loader.load_model(mydir + "/Box.egg")
        box_model = box_file.find("+GeomNode")
        box_model.set_scale(1, 1, 1)
        box_model.reparent_to(self.box_np)
        sh = Shader.make(Shader.SL_GLSL, vertex=vert, fragment=frag)
        box_model.set_shader(sh)

But I keep getting this error:

Known pipe types:
  wglGraphicsPipe
(all display modules loaded.)
:display:gsg:glgsg(error): An error occurred while linking GLSL shader created-shader
Vertex info
-----------
(0) : error C3001: no program defined

Fragment info
-------------
(0) : error C3001: no program defined

I’ve tried to keep everything as basic as possible. What am I doing wrong?

Replace void shader() on the void main ()

And it should work.

Yep, that worked. Thank you so much! I had been staring at that for like an hour and making no progress.