I want to run <graphics.h>
in VsCode. For that, i downloaded the 3 files(graphics.h, winbgim.h and libbgi.a) and pasted them in their respective folders and the sqqiggly lines under graphics.h are not coming anymore. But when I go to execute the following code -
#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;
}
errors pop out as follows -
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
Can anyone tell me what I did wrong? Also now I cannot install dev c++ or codeblocks because of a messy uninstallation of them a few days back.