Error due to #include <graphics.h>

I am trying to compile a program that includes a header file graphics.hfor C. I have added header files to graphics.hboth the winbgim.hinclude folder as well libbgi.aas the lib folder.

Just for testing, I made a simple welcome program and included the header file graphics.h.

But when compiling, I got the following error:

In the file included in firstc.c: 2: 0: C: \ MinGW \ bin ../ Library / GCC / mingw32 / 4.7.1 /../../../../ include / graphics.h: 30: 59: fatal error: sstream: no such file or directory compilation stops.

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

Another question, I came across other graphical parameters for C and C ++, such as openGL and DirectX. Should I study them instead of graphics.h?

+4
source share
4 answers

graphics.h- custom title. Most likely, this refers to the old BGI graphics library of the Turbo C DOS compiler. It will only work on this particular compiler. And, of course, DOS is a completely outdated OS at present.

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

+7
source

"graphics.h" code:: blocks IDE, winBGIm.

  • winBGIm http://winbgim.codecutter.org/ ( )
  • .
  • graphics.h, 302, int right=0 int top=0
  • graphics.h winbgim.h include .
  • libbgi.a lib
  • :: open SettingsCompiler and debuggerlinker settings
  • Add , libbgi.a
  • (, )
    -lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32
  • Ok

.

Compiler options

+2

C graphics.h, .cpp. "fatal error: sstream: no such file directory".

, .c .cpp. graphics.h, Code:: Blocks .

+1

, , ... lbgi-lgdi32... , .

0

Source: https://habr.com/ru/post/1570452/


All Articles