'Why don't online C++ IDEs support "graphics.h" header file?
I tried compiling code using several IDEs of C++ using "graphics.h" header file using the list in TechGeekBuzz: Best C++ Online Compiler but they flag the error
1:21: fatal error: graphics.h: No such file or directory
The program I am trying to run is
#include<graphics.h>
#include <conio.h>
int main()
{
int gd = DETECT, gm;
initgraph(&gd,&gm, "C:\\tc\\bgi");
circle(300,300,50);
closegraph();
getch();
}
Solution 1:[1]
You should only expect the standard headers to be available in online compilers. Some (but not all) also provide posix headers or very popular libraries such as boost.
Neither <graphics.h> nor <conio.h> are standard headers. Both are old MSDOS legacy that you will not find on any online compiler:
conio.hoffers non-standard and non-portable console functions, like for example the famouskbhit().- graphics.h is a vendor specific header for a library that is no longer supported since 1997.
In addition, online compilers provide a command line interface. They are not suitable for graphic development.
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 |
