dev c++中graphics.h中的链接器错误

linker errors in graphics.h in dev c++

本文关键字:链接 错误 c++ graphics dev      更新时间:2023-10-16

我正在尝试学习图形程序,当我关闭并重新打开我的文件时,我收到一条消息说"[链接器]错误在..",指的是所有指向graphics.h的命令。我用的是windows 7,我已经下载了WIN华大基因软件到我的电脑上。下面是我的代码:

#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;
}
有人能帮我一下吗?

这是古老的;你可能想要考虑摆脱旧的Turbo C编译器,然后升级你的图形需求:

  • QT
  • 怪物
  • GTK +