-2

I'm trying to learn the graphics program and when I close and reopen my file I get a message that says "[linker] error in.." referring to all the commands that refer to graphics.h. I am using windows 7 and I have downloaded the WIN BGI program onto my computer. Here is my code:

#include <stdio.h>
#include <stdlib.h>
#include <graphics.h>
#include <conio.h>
#include <commctrl.h>

main()
{
   int gd = DETECT, gm, i, j, number, last;
   initgraph(&gd, &gm, "C:\\TC\\BGI");
   int k=360;

   for(i=0; i<5; i++){
            setcolor(BROWN);
            line(150, 250+i, 150+k, 250+i);}
   for(i=0; i<5; i++){
            line(150, 10+i, 150+k, 10+i);}

   number=int(k/16);
   last=k%16;


  for (i=0; i<k; i=i+16){
      if((145+k)<=(155+i))break;
      else;
      for(j=0; j<5; j++){
                line(150+i+j, 250, 150+i+j, 15);}
                }
  if(last!=0){
              for(i=0; i<5; i++){line(150+k-i, 250, 150+k-i, 15);}
              }

   printf("How many doors are there?\n");
   scanf("%d", &number);

   if(number!=0){
                 number++;
                 for(i=(150+(k/number)); i<(150+k); i=(i+(k/number))){
                                         setcolor(BLACK);
                                         for(j=0; j<100; j++) line(i, 250-j, i+65, 250-        j);
                                         }
                                         } 


   getch();
   closegraph();
   return 0;
}

Can somebody help me out?

genpfault
  • 51,148
  • 11
  • 85
  • 139
  • 1
    Possible duplicate of http://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix – πάντα ῥεῖ May 04 '14 at 22:57
  • @πάνταῥεῖ: I don't think the symptoms here can be treated that way, he needs to address the cause (usage of a non-standard API not supported by current compilers) – Ben Voigt May 04 '14 at 23:07
  • @BenVoigt That was just a quick shot. I still had the link in my copy buffer ;) ... – πάντα ῥεῖ May 04 '14 at 23:08

1 Answers1

1

That is ancient; you may want to consider breaking away from that ol' Turbo C compiler and then upgrade your graphics needs to:

  • QT
  • Ogre
  • GTK+
  • Right diagnosis, but none of those frameworks are going to be much help getting this running again. Some simple line graphics system like SDL would probably be much more suitable. BTW, I suspect you meant [Ogre](http://www.ogre3d.org/)? – Ben Voigt May 04 '14 at 23:08