You might get graphics.h
compiled (as #include
d 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.
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
Решение
Другие советы
Of course you could compile graphics.h with gcc
but you have to follow certain steps.
- Get the files
graphics.h
from graphics andlibbgi.a
from library. - Copy the
graphics.h
file to theinclude
directory of your gcc compiler. - Copy the
libbgi.a
file to thelib
directory of your gcc compiler. 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 ofgcc
.
Не связан с StackOverflow