title: Cant compile c++ program using mathgl
body: <p>I have installed the mathgl library using </p>
  
  <pre><code>sudo apt-get install mathgl
  </code></pre>
  
  <p>Then from their sourceforge page I copied the following example program.</p>
  
  <pre><code>#include &lt;mgl2/qt.h&gt;
  int sample(mglGraph *gr)
  {
    gr-&gt;Rotate(60,40);
    gr-&gt;Box();
    return 0;
  }
  
  int main(int argc,char **argv)
  {
    mglQT gr(sample,"MathGL examples");
    return gr.Run();
  }
  </code></pre>
  
  <p>And the</p>
  
  <pre><code>gcc test.cpp -lmgl-qt -lmgl -lm
  </code></pre>
  
  <p>I get the following error message </p>
  
  <pre><code>test.cpp:1:21: fatal error: mgl2/qt.h: No such file or directory
   #include &lt;mgl2/qt.h&gt;
                       ^
  compilation terminated.
  </code></pre>
  
  <p>Now I looked for this header file using locate and I couldn't find it. I get this problem so often that I install a library and then spend ages trying to get the compiler to know where to find the linker and header files (I am a bit of a beginner) and I think to myself there must be a better way or something that I am missing. So how can I locate the files I need and let the compiler know where to search?</p>