'Can gcc compile graphics.h or will graphic.h only compile with the borlan turbo c compiler
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
Solution 1:[1]
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.
Solution 2:[2]
Of course you could compile graphics.h with gcc but you have to follow certain steps.
- Get the files
graphics.hfrom graphics andlibbgi.afrom library. - Copy the
graphics.hfile to theincludedirectory of your gcc compiler. - Copy the
libbgi.afile to thelibdirectory of your gcc compiler. Afterwards execute the code:
C:\>gcc your_filename.c -lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32Also if you are executing a c++ program use
g++instead ofgcc.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | alk |
| Solution 2 |
