title: Allegro 5 crashes on calling al_clear_to_color(ALLEGRO_COLOR)
body: <p>I'm starting at Allegro 5, but soon I got stuck in the second hello-world-like program I'm coding. After some debugging, I concluded that the program crashes when it calls the function <code>al_clear_to_color(ALLEGRO_COLOR)</code>. I've tried linking allegro statically and dynamically, but the problem still remains. I'm completely lost.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>#include &lt;cstdio&gt;
  #include &lt;allegro5/allegro.h&gt;
  
  int main() {
      ALLEGRO_DISPLAY         *display;
      ALLEGRO_KEYBOARD_STATE  kbState;
  
      if(!al_init())
          return 0;
  
      if(!al_install_keyboard())
          return 0;
  
      display = al_create_display(800, 600);
      if(!display)
          return 0;
  
      do {
          al_get_keyboard_state(&amp;kbState);
  
          al_clear_to_color(al_map_rgb(255, 255, 255));
  
          al_flip_display();
  
          al_rest(0.5);
      } while(!al_key_down(&amp;kbState, ALLEGRO_KEY_ESCAPE));
  
      al_destroy_display(display);
  
      return 0;
  }
  </code></pre>
  
  <p>edit:</p>
  
  <p>Substituting  the line</p>
  
  <pre><code>al_clear_to_color(al_map_rgb(255, 255, 255));
  </code></pre>
  
  <p>for the line</p>
  
  <pre><code>al_clear_to_color(tempClearColor);
  </code></pre>
  
  <p>declaring</p>
  
  <pre><code>ALLEGRO_COLOR tempClearColor = al_map_rgb(255, 255, 255);
  </code></pre>
  
  <p>before the loop starts, it does work, but crashes when the function</p>
  
  <pre><code>al_destroy_display(display);
  </code></pre>
  
  <p>is called.</p>
  
  <p>The debugger returns the messages:<br></p>
  
  <blockquote>
    <p>Error while reading shared library symbols for C:\Program Files (x86)\CodeBlocks\MinGW\bin\libstdc++-6.dll:<br>
    Program received signal SIGSEGV, Segmentation fault.</p>
  </blockquote>