title: Graphics.h c++ undefined reference to various functions like line(),initgraph()
body: <pre><code>#include&lt;graphics.h&gt;
  #include&lt;stdio.h&gt;
  
  main()
  {
  int gd=DETECT,gm;
  int i,x,y;
  initgraph(&amp;gd,&amp;gm,&quot;&quot;);
  line(0,0,640,0);
  line(0,0,0,480);
  line(639,0,639,480);
  line(639,479,0,479);
  for(i=0;i&lt;=1000;i++)
  {
     x=rand()%639;
     y=rand()%480;
     putpixel(x,y,15);
  }
    getch();
    closegraph();
  }
  </code></pre>
  <p>The Following is a Basic Graphic Program,It Shows the Errors as</p>
  <ol>
  <li><p>undefined reference to 'initgraph'</p>
  </li>
  <li><p>undefined reference to 'closegraph'</p>
  </li>
  <li><p>undefined reference to 'line'[4 times]</p>
  </li>
  <li><p>undefined reference to 'putpixel'</p>
  <p>Compiler : CodeBlocks;  Language:c++;</p>
  </li>
  </ol>
  <hr />
  <p>I Have Copied the graphics.h and winbgim.h    in include folder and the libbgi.a in the lib folder also i have linked all the  libraries required to be linked. Please Help.</p>