title: Openal - alGetError() always returns AL_INVALID_OPERATION
body: <p>i'm running ubuntu 12.04 off a pendrive.  I've installed openAL and alut
  my main is:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  #include &lt;iostream&gt;
  #include &lt;al.h&gt; 
  #include &lt;alc.h&gt;
  
  // Buffers hold sound data.
  ALuint Buffer;
  using namespace std;
  string ErrorCheck(ALenum error)
  {
      if(error == AL_INVALID_NAME)
      {
          return "Invalid name";
      }
      else if(error == AL_INVALID_ENUM)
      {
          return " Invalid enum ";
      }
      else if(error == AL_INVALID_VALUE)
      {
          return " Invalid value ";
      }
      else if(error == AL_INVALID_OPERATION)
      {
          return " Invalid operation ";
      }
      else if(error == AL_OUT_OF_MEMORY)
      {
          return " Out of memory like! ";
      }
  
      return " Don't know ";
  
  
  }
  
  int main(int argc, char **argv)
  
  {
      ALenum error;   
  
      error = alGetError();
      cout &lt;&lt; "\n\tInitial error at start of program - " &lt;&lt; ErrorCheck(error);
  
      error = alGetError();
      cout &lt;&lt; "\n\tError persists - " &lt;&lt; ErrorCheck(error);
  
      cout &lt;&lt; "\n\tGenerating buffer...";
      alGenBuffers(1, &amp;Buffer);
  
      error = alGetError();
      if(error != AL_NO_ERROR)
      {
          cout &lt;&lt; "\n\tError generating buffer - "&lt;&lt; ErrorCheck(error) &lt;&lt; "\n\n";
          return 0;
      }
  
  
      return 0;
  }
  </code></pre>
  
  <p>This compiles without error using the line</p>
  
  <pre><code>g++ main.cpp -I/usr/include/AL -lopenal -lalut
  </code></pre>
  
  <p>But when the program runs, every call to alGetError() returns AL_INVALID_OPERATION
  I thought that calling alGetError() was meant to reset the the error flag, so where i call it twice at the start, the second one should at least return no error.
  I am truly stuck!</p>