title: Undefined references when using graphics.h?
body: <p>I am trying to use graphics.h in dev C++ 5.7.1.</p>
  
  <p>I already searched the internet for the available options.
  I downloaded the graphics.h library in the include folder and chose the following in the parameters option:</p>
  
  <pre><code>-lbgi
  -lgdi32
  -lcomdlg32
  -luuid
  -loleaut32
  -lole32
  </code></pre>
  
  <p>Still I cannot figure out why is it showing me these errors:</p>
  
  <pre><code>undefined reference to `initgraph'
  undefined reference to `graphresult'
  undefined reference to `grapherrormsg'
  undefined reference to `getmaxx'
  undefined reference to `getmaxy'
  undefined reference to `getmaxcolor'
  undefined reference to `getcolor'
  undefined reference to `circle'
  undefined reference to `closegraph'
  [Error] ld returned 1 exit status.
  </code></pre>
  
  <p>This is my code:</p>
  
  <pre><code>#include&lt;iostream&gt;
  #include&lt;graphics.h&gt;
  #include&lt;stdlib.h&gt;
  #include&lt;stdio.h&gt;
  //#include&lt;conio&gt;
  int main(void)
  {
         /* request auto detection */
         int gdriver = DETECT, gmode, errorcode;
         int midx, midy;
         int radius = 100;
         /* initialize graphics and local variables */
         initgraph(&amp;gdriver, &amp;gmode, "C:\\Program Files (x86)\\Dev-Cpp\\MinGW64\\include\\winbgim");
         /* read result of initialization */
         errorcode = graphresult();
         if (errorcode != grOk)  /* an error occurred */
         {
             printf("Graphics error: %s\n", grapherrormsg(errorcode));
          printf("Press any key to halt:");
        getch();
        exit(1); /* terminate with an error code */
     }
     midx = getmaxx() / 2;
     midy = getmaxy() / 2;
     setcolor(getmaxcolor());
     /* draw the circle */
     circle(midx, midy, radius);
     /* clean up */
     getch();
     closegraph();
     return 0;
  }
  </code></pre>