为什么在线C ++ IDE不支持"graphics.h"?头文件? [英] Why don't online C++ IDEs support "graphics.h" header file?

查看:83
本文介绍了为什么在线C ++ IDE不支持"graphics.h"?头文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用

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:致命错误:graphics.h:没有此类文件或目录

1:21: fatal error: graphics.h: No such file or directory

我要运行的程序是

#include<graphics.h>
#include <conio.h>
int main()
{
    int gd = DETECT, gm;
    initgraph(&gd,&gm, "C:\\tc\\bgi");
    circle(300,300,50);
    closegraph();
    getch();
}

推荐答案

您应该只希望在线编译器中可以使用标准头文件.一些(但不是全部)还提供posix标头或非常流行的库(例如boost).

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.

<graphics.h>

Neither <graphics.h> nor <conio.h> are standard headers. Both are old MSDOS legacy that you will not find on any online compiler:

  • conio.h 提供了非标准且不可移植的控制台功能,例如例如著名的 kbhit() .
  • graphics.h 是该库的特定于供应商的标头,自1997年以来不再受支持
  • conio.h offers non-standard and non-portable console functions, like for example the famous kbhit().
  • 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.

这篇关于为什么在线C ++ IDE不支持"graphics.h"?头文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆