"undefined reference to `closegraph' collect2.exe: error: ld returned 1 exit status" i got this error but cant solve it

Viewed 23

This is the code for printing a circle....i recently installed a graphics library and wanted to try it....but got this error

"\C++ Practice folder\New folder/main.cpp:9: undefined reference to `closegraph'
collect2.exe: error: ld returned 1 exit status."

i tried searching it but couldn't fix it.

#include <graphics.h>
using namespace std;
int main(int argc, char const *argv[])
{
    int gd = DETECT, gm;
    initgraph(&gd, &gm, (char *)"");
    circle(320, 240, 200);
    getch();
    closegraph();
    return 0;
}
0 Answers
Related