0

<graphics.h>VsCodeで実行したい。そのために、3 つのファイル (graphics.h、winbgim.h、および libbgi.a) をダウンロードし、それぞれのフォルダーに貼り付けました。graphics.h の下の sqqiggly 行は表示されなくなりました。しかし、次のコードを実行すると-

#include<graphics.h>
int main()
{   

int gd=DETECT,gm;
initgraph(&gd,&gm,(char*)"");

circle(200,200,100);
line(200,500,45,485);
getch();
closegraph();
return 0;
}

次のようにエラーが表示されます-

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS C:\Users\me\Documents\C++ programs> cd "c:\Users\me\Documents\C++ programs\graphics\" ; if ($?) { g++ temp.cpp -o temp } ; if ($?) { .\temp }
C:\Users\me\AppData\Local\Temp\ccLUwEoL.o:temp.cpp:(.text+0x27): undefined reference to `initgraph' 
C:\Users\me\AppData\Local\Temp\ccLUwEoL.o:temp.cpp:(.text+0x3c): undefined reference to `circle'    
C:\Users\me\AppData\Local\Temp\ccLUwEoL.o:temp.cpp:(.text+0x57): undefined reference to `line'      
C:\Users\me\AppData\Local\Temp\ccLUwEoL.o:temp.cpp:(.text+0x66): undefined reference to `closegraph'
collect2.exe: error: ld returned 1 exit status

誰が私が間違ったことを教えてもらえますか? また、数日前に面倒なアンインストールが行われたため、dev c++ またはコードブロックをインストールできません。

4

0 に答える 0