Can gcc compile graphics.h or will graphic.h only compile with the borlan turbo c compiler

StackOverflow https://stackoverflow.com/questions/19537564

  •  01-07-2022
  •  | 
  •  

Вопрос

I see everyone recommends just using openGL and some others but I don't wanna. I just want to know if graphic.h will only compile in turbo c and not with gcc, Thanks

Это было полезно?

Решение

You might get graphics.h compiled (as #included part of some sources), but the linking (coming after the compilation) will fail, as gcc's linker (ld) would not link the compilation's result against the library (graphics.lib) implementing what graphics.h prototyped.

Другие советы

Of course you could compile graphics.h with gcc but you have to follow certain steps.

  1. Get the files graphics.h from graphics and libbgi.a from library.
  2. Copy the graphics.h file to the include directory of your gcc compiler.
  3. Copy the libbgi.a file to the lib directory of your gcc compiler.
  4. Afterwards execute the code:

    C:\>gcc your_filename.c -lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32

    Also if you are executing a c++ program use g++ instead of gcc.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top