I have written a code in C++, which is given below. The program is compiling successfully. But, when I'm trying to run the .exe file, then I am not getting the desired output.
My Code:
#include<graphics.h>
#include<stdio.h>
#include<conio.h>
#include<dos.h>
int main( )
{
int gd = DETECT, gm;
initgraph(&gd, &gm, (char*)"");
setcolor(BLUE);
line(100, 100, 200, 200);
getch();
closegraph();
}
I am using the following command in Windows Command Prompt to compile the program:
g++ -m32 -o trial trial.cpp -lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32 "C:\TDM-GCC-64\x86_64-w64-mingw32\lib\libbgi.a"
To run my .exe file:
trial
for cmd and ./trial
in powershell.
But after this I am not getting any output. Why is it so?