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