Code: Select all
#include
int main()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,(char*)"");
circle(200,200,100);
line(200,500,45,485);
getch();
closegraph();
return 0;
}
Code: Select all
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