'Graphics program not run in Borland c++ ,what i do?
when i run simple graphics program Borland c++ throw Error "BGI graphics not supported under windows"
#include<graphics.h>
#include<conio.h>
void main() { int gd = DETECT, gm;
initgraph(&gd, &gm, "C:\\TC\\BGI");
circle(100, 100, 50);
getch(); closegraph();
}
Solution 1:[1]
Maybe you can try this:
go to Options -> Linker -> Libraries
then select the graphics library.
Solution 2:[2]
If you don't want to run DOS you might have some luck investigating WinBGI, perhaps here http://winbgim.codecutter.org, but the project looks like it's gone to seed. Ultimately BGI is an obsolete and unsupported technology.
If you're just having a bit of a play, perhaps the HTML Canvas element would be a plausible alternative. This page has a few demos you can modify on the fly http://www.w3schools.com/html/html5_canvas.asp
See also this similar question How can I compile code that uses graphics.h in DOSBOX?
HTH.
Solution 3:[3]
Run your program under MS-DOS or switch to another graphics library.
(BTW the last time I had something to do with BGI was in the 90s...)
Solution 4:[4]
Well, one thing you can do is try turbo c++ compiler. Borland in new and doesn't support BGI graphics. I had the same problem and it is much better to use turbo c++ (not 4.5 version). Last year I had to use them and Borland didn't support them. I loved Borland compiler.
TIP: if you are not learning BGI graphics for some special reason, I would suggest you to use other graphic libraries in other compilers (like Code::blocks) which support new c++ standards.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | amolgautam |
| Solution 2 | Community |
| Solution 3 | Axel |
| Solution 4 | Ayush Mahajan |
