由于#include<graphics.h> 导致的错误 [英] Error due to #include<graphics.h>
问题描述
我正在尝试编译一个包含 C 的 graphics.h
头文件的程序.我添加了 graphics.h
和 winbgim.h
include 文件夹中的头文件以及 libbgi.a
到 lib 文件夹中.
I am trying to compile a program which includes the graphics.h
header file for C. I have added the graphics.h
and winbgim.h
header files in the include folder and also libbgi.a
to lib folder.
为了测试,我制作了一个简单的 hello world 程序并包含了 graphics.h
头文件.
Just for testing, I made a simple hello world program and included the graphics.h
header file.
但在编译时出现以下错误:
But on compiling I got the following error:
在 firstc.c:2:0 包含的文件中:c:mingwin../lib/gcc/mingw32/4.7.1/../../../../include/graphics.h:30:59:致命错误:sstream:没有这样的文件或目录编译终止.
In file included from firstc.c:2:0: c:mingwin../lib/gcc/mingw32/4.7.1/../../../../include/graphics.h:30:59: fatal error: sstream: No such file or directory compilation terminated.
我也尝试过在其他论坛中搜索过同样的问题,但没有得到答案.
I tried to search in other forums as well, where the same question had been asked, but could not get an answer.
另一个问题,我遇到了 C 和 C++ 的其他图形选项,如 openGL 和 DirectX.我应该学习这些而不是 graphics.h?
Another question, I came across other graphic options for C and C++ like openGL and DirectX. Should I learn these instead of graphics.h?
推荐答案
graphics.h
是一个非标准的标题.它很可能是指 Turbo C DOS 编译器的旧 BGI 图形库.它只适用于那个特定的编译器.当然,DOS 现在是一个完全过时的操作系统.
graphics.h
is a non-standard header. Most likely it refers to the old BGI graphics library of the Turbo C DOS compiler. It will only work on that particular compiler. And of course DOS is a completely obsolete OS nowadays.
如果您对 3D 图形编程感兴趣,那么 OpenGL 和/或 DirectX 确实是更好的现代替代品,受到许多编译器的支持.
If you are interested in 3D graphics programming, then OpenGL and/or DirectX are indeed better, modern alternatives, supported by many compilers.
这篇关于由于#include<graphics.h> 导致的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!