title: OpenGL Shaders: glLinkProgram() and glValidateProgram() doesn't work
body: <p>I've been following along with <a href="http://youtu.be/8n1GV99FJ2Y?t=7m9s" rel="nofollow noreferrer">this</a> tutorial, and that particular video is where my problem comes from. At that time in the video, he begins incorporating his Shader class (I copied everything exactly how he did it, by the way). Anyways, when I call the compileShader() method, which looks like this,</p>
  
  <pre><code>public void compileShader()
  {
      glLinkProgram(program);
  
      if(glGetProgrami(program, GL_LINK_STATUS) == GL_FALSE)
      {
          System.err.println(glGetShaderInfoLog(program, 1024));
          System.exit(1);
      }
  
      glValidateProgram(program);
  
      if(glGetProgrami(program, GL_VALIDATE_STATUS) == GL_FALSE)
      {
          System.err.println(glGetShaderInfoLog(program, 1024));
          System.exit(1);
      }
  } 
  </code></pre>
  
  <p>My program crashes because the glGetProgrami(program, GL_LINK_STATUS) ALWAYS equals GL_FALSE (GL_FALSE == 0). Same for the glGetProgrami(program, GL_VALIDATE_STATUS), it returns GL_FALSE. By the way, I used glGetProgrami() instead of glGetProgram() because the latter is a deprecated method. Also, System.err.println(glGetShaderInfoLog(program, 1024)) doesn't print ANYTHING.</p>
  
  <p>After a thorough online search of the main problem, <a href="https://stackoverflow.com/a/8612637/3584262">this</a> was the only thread I could find that resembled my problem, it actually seems like the exact same problem. His solution is to change the 3D settings of his intel graphics card, but when I try to follow his steps, I don't have the same options he has for configuring 3D settings. As it turns out, the program my laptop has for configuring the intel graphics settings is different from his! </p>
  
  <p>So after spending hours looking online for solutions for getting his control panel, which was just installing drivers, none of which actually worked, I came across <a href="https://communities.intel.com/thread/54879" rel="nofollow noreferrer">this</a> thread. The third post says that those options are obsolete, and that the options I have are the only ones I need. But after messing around with the settings I have, NOTHING CHANGES. The program still crashes.</p>
  
  <p>I don't understand why glLinkProgram(program) isn't linking the program as well as why glGetShaderInfoLog() doesn't return anything.</p>
  
  <p>EDIT:</p>
  
  <pre><code>private void addProgram(String text, int type)
  {
      int shader = glCreateShader(type);
  
      if(shader == 0)
      {
          System.err.println("Shader creation failed: Could not find valid memory location when adding shader");
          System.exit(1);
      }
  
      glShaderSource(shader, text);
      glCompileShader(shader);
  
      if(glGetShaderi(shader, GL_COMPILE_STATUS) == GL_FALSE)
      {
          System.err.println(glGetShaderInfoLog(shader, 1024));
          System.exit(1);
      }
  
      glAttachShader(program, shader);
  }
  </code></pre>
  
  <p>Here is the code that actually calls glCompileShader(). It's called whenever you want to add a shader. This part is successful and is called before the compile() method.</p>