Ayushi Jha Ayushi Jha - 3 years ago 190
C Question

Error due to #include<graphics.h>

I am trying to compile a program which includes the

header file for C. I have added the
header files in the include folder and also
to lib folder.

Just for testing, I made a simple hello world program and included the
header file.

But on compiling I got the following error:

In file included from firstc.c:2:0:
fatal error: sstream: No such file or directory compilation

I tried to search in other forums as well, where the same question had been asked, but could not get an answer.

Another question, I came across other graphic options for C and C++ like openGL and DirectX. Should I learn these instead of graphics.h?

Answer Source

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.

If you are interested in 3D graphics programming, then OpenGL and/or DirectX are indeed better, modern alternatives, supported by many compilers.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download