C C++ Graphics program in Linux -
i have program in c language: http://rajababuman.blogspot.com/p/graphics-in-turbo-c.html.
it works fine if use dosbox on win7 machine , using turboc++ , shows me it's doing. but, how can run following graphics program on linux machine (where don't have dosbox or turboc++)? ps: display environment variable set local machine's ip address show me gui/graphics on linux box i.e. if run "xclock", clock shows on machine successfully.
i know turbo c windows tool , uses windows api.
i don't have use graphics.h header file, if can simple c program on linux machine, when compile, gives me same output (as program giving me on windows machine) on linux machine (without me intsalling/using dosbox or turboc).
///////////////////////////////////////////////////////////////////////////////////////// //diagram of car /////////////////////////////////////////////////////////////////////////////////////// #include<stdio.h> #include<graphics.h> void main() { int gd=detect,gm; initgraph(&gd,&gm,""); rectangle(100,200,200,250); rectangle(220,200,320,250); rectangle(90,190,330,290); circle(150,290,30); circle(270,290,30); getch(); }
when compile program on linux machine, following errors:
[koba@server1 lory]$ gcc g.c
g.c:2:21: error: graphics.h: no such file or directory g.c: in function âmainâ: g.c:5: error: âdetectâ undeclared (first use in function) g.c:5: error: (each undeclared identifier reported once g.c:5: error: each function appears in.) g.c:4: warning: return type of âmainâ not âintâ
[koba@server1 lory]$
[koba@server1 lory]$ cc g.c
g.c:2:21: error: graphics.h: no such file or directory g.c: in function âmainâ: g.c:5: error: âdetectâ undeclared (first use in function) g.c:5: error: (each undeclared identifier reported once g.c:5: error: each function appears in.) g.c:4: warning: return type of âmainâ not âintâ
[koba@server1 lory]$
the "graphics.h" header file of 1 of libraries supported turbo c++, it's dedicated dos.
if want use dosbox in linux, please try downloading "dosbox-0.74.tar.gz" project website linux machine, , compile , run it.
Comments
Post a Comment