Reputation: 83
I already have graphics.h(and relevant files in MinGW ) but the programs are not working, because after build and run, I get required text output on output window but not the corresponding graphics because program_name.exe stops working. I already have searched all over the internet, StackOverflow is my final hope. I have been doing competitive programming in c+ +, just tried to get into graphics with c++ in code blocks.
#include <graphics.h>
#include <iostream>
using namespace std;
int main()
{ cout<<"a";
int gd= DETECT,gm ;
char driver[] = "";
initgraph(&gd, &gm, driver);
//initgraph(&gd,&gm," ");
circle (100,100,100) ;
getch();
closegraph();
return 0;
}
Upvotes: 0
Views: 209
Reputation: 65
This is VERY retro. In order for this to even come CLOSE to working you will need to create an MSDOS virtual machine under something like VirtualBox, install DOS 6.2 or similar, install the Borland BGI, Borland C++ 5.02 and then you MIGHT get it to work. Failing that, you could just find an old IBM PC and install DOS on it along with everything else above. Have fun!
Upvotes: 1