BGI graphics not supported in windows..

Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Apr 2007
Posts: 12
Reputation: akmaahamed_2005 is an unknown quantity at this point 
Solved Threads: 0
akmaahamed_2005's Avatar
akmaahamed_2005 akmaahamed_2005 is offline Offline
Newbie Poster

BGI graphics not supported in windows..

 
0
  #1
May 7th, 2007
hi!

i tried to run the following program in BORLAND C++ version 5.02..

  1. #include<stdio.h>
  2. #include<graphics.h>
  3. #include<string.h>
  4. #include<math.h>
  5. #include<conio.h>
  6. int const monthcount=12,dataoffset=18;
  7.  
  8. struct indata
  9. {
  10. float realarray[ 12];
  11. float array[ 12];
  12. };
  13.  
  14. char getlabel[3];
  15. indata data;
  16. int monthplace[ 12];
  17. float interval,chartbottom,radius;
  18.  
  19. struct wcp
  20. {
  21. float x;
  22. float y;
  23. } coord[monthcount];
  24.  
  25. wcp center;
  26.  
  27. int round(float a)
  28. {
  29. int b;
  30. b=a;
  31. if(a-b>0.5)
  32. return ++b;
  33. else
  34. return b;
  35. }
  36.  
  37. void polyline(int x, wcp *y)
  38. {
  39. for(int i=0;i<x-1 ;i++)
  40. line(y[i].x,y[i].y,y[i+1].x,y[i+1].y);
  41. }
  42.  
  43. void getlab(int x)
  44. {
  45. switch(x)
  46. {
  47. case 0:
  48. {
  49. strcpy(getlabel,"JAN");
  50. break;
  51. }
  52. case 1:
  53. {
  54. strcpy(getlabel ,"FEB");
  55. break;
  56. }
  57. case 2:
  58. {
  59. strcpy(getlabel," MAR");
  60. break;
  61. }
  62. case 3:
  63. {
  64. strcpy(getlabel,"APR");
  65. break;
  66. }
  67. case 4:
  68. {
  69. strcpy(getlabel,"MAY");
  70. break;
  71. }
  72. case 5:
  73. {
  74. strcpy(getlabel,"JUN");
  75. break;
  76. }
  77. case 6:
  78. {
  79. strcpy(getlabel,"JUL");
  80. break;
  81. }
  82. case 7:
  83. {
  84. strcpy(getlabel,"AUG" );
  85. break;
  86. }
  87. case 8:
  88. {
  89. strcpy(getlabel,"SEP");
  90. break;
  91. }
  92. case 9:
  93. {
  94. strcpy(getlabel,"OCT");
  95. break;
  96. }
  97. case 10:
  98. {
  99. strcpy(getlabel,"NOV");
  100. break;
  101. }
  102. case 11:
  103. {
  104. strcpy(getlabel,"DEC");
  105. break;
  106. }
  107. }
  108. }
  109.  
  110. void getdata()
  111. {
  112. float t1=0.00,t2;
  113. for(int t=0;t<12;t++)
  114. {
  115. getlab(t);
  116. printf("ENTER THE DATA FOR THE MONTH OF %s: ",getlabel);
  117. scanf("%f",&data.realarray[t]);
  118. if(data.realarray[t]>t1 )
  119. {
  120. t1=data.realarray[t];
  121. }
  122. }
  123. for(t=0;t<12;t++)
  124. {
  125. t2=data.realarray[t]/t1;
  126. data.array[t]=t2*400;
  127. }
  128. }
  129.  
  130. void puttext(wcp textp)
  131. {
  132. settextstyle(1,HORIZ_DIR,1);
  133. outtextxy(textp.x,textp.y,getlabel);
  134. }
  135.  
  136. void drawlabels()
  137. {
  138. wcp textposition;
  139. textposition.y=chartbottom;
  140. int zz=25;
  141. for(int az=0;az<12;az++)
  142. {
  143. textposition.x=zz;
  144. zz+=50;
  145. getlab(az);
  146. puttext(textposition);
  147. }
  148. }
  149.  
  150. char valuep[5];
  151.  
  152. void findvaluep(int x)
  153. {
  154. int y=x,ttt;
  155. char tg[5];
  156. strcpy(tg,"");
  157. do
  158. {
  159. ttt=y%10;
  160. switch(ttt)
  161. {
  162. case 0:
  163. {
  164. strcat(tg,"0");
  165. break;
  166. }
  167. case 1:
  168. {
  169. strcat(tg,"1");
  170. break;
  171. }
  172. case 2:
  173. {
  174. strcat(tg,"2");
  175. break;
  176. }
  177. case 3:
  178. {
  179. strcat(tg,"3");
  180. break;
  181. }
  182. case 4:
  183. {
  184. strcat(tg,"4");
  185. break;
  186. }
  187. case 5:
  188. {
  189. strcat(tg,"5");
  190. break;
  191. }
  192. case 6:
  193. {
  194. strcat(tg,"6");
  195. break;
  196. }
  197. case 7:
  198. {
  199. strcat(tg,"7");
  200. break;
  201. }
  202. case 8:
  203. {
  204. strcat(tg,"8");
  205. break;
  206. }
  207. case 9:
  208. {
  209. strcat(tg,"9");
  210. break;
  211. }
  212. }
  213. y/=10;
  214. } while(y>0);
  215. strcpy(valuep,"");
  216. for(y=0;y<strlen(tg);y++)
  217. {
  218. valuep[y]=tg[strlen(tg)-y-1];
  219. }
  220. valuep[y]=NULL;
  221. }
  222.  
  223.  
  224. void linechart()
  225. {
  226. drawlabels();
  227. settextstyle(DEFAULT_FONT,HORIZ_DIR,1);
  228. for(int t=0;t<monthcount;t++)
  229. {
  230. coord[t].x=monthplace[t];
  231. coord[t].y=450-data.array[t]-dataoffset;
  232. findvaluep(data.realarray[t]);
  233. outtextxy(coord[t].x,coord[t].y-10,valuep);
  234. }
  235. polyline(monthcount,coord);
  236. }
  237.  
  238. void main()
  239. {
  240. int gdriver=DETECT,gmode;
  241. initgraph(&gdriver,&gmode,"");
  242. getdata();
  243. cleardevice();
  244. chartbottom=450.0;
  245. interval=50.0;
  246. monthplace[0]=25;
  247. for(int z=1;z<monthcount;z++)
  248. monthplace[z]=monthplace[z-1 ]+interval;
  249. linechart();
  250. getch();
  251. cleardevice();
  252. closegraph();
  253. }

but it tells me that BGI graphics is not supported under windows..
what does this mean????????

i tried googling it, but couldn't understand how to solve it, all i came to know is that there is some other header file to be used..

now what should i do?.. if i am to change the header file, then where to get the new header file from? and how to use this??

i am new to graphics programming in Borland c++, so i am not able to understand much... hence, if possible plz give me the exact procedure to follow..

plz help me out..
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 7,619
Reputation: ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of 
Solved Threads: 468
Super Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Failure as a human

Re: BGI graphics not supported in windows..

 
0
  #2
May 7th, 2007
Which OS are you on and how were you trying to execute the program?
I don't accept change; I don't deserve to live.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,442
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1474
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: BGI graphics not supported in windows..

 
0
  #3
May 7th, 2007
That error message seems pretty clear to me -- it means that your compiler can not compile that program because it contains code that is no longer supported. You will have to use an older Borland compiler, such as Turbo C.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 3,114
Reputation: WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of 
Solved Threads: 281
Moderator
WaltP's Avatar
WaltP WaltP is offline Offline
Posting Sensei

Re: BGI graphics not supported in windows..

 
1
  #4
May 7th, 2007
BGI graphics was designed for earlier Borland compilers and won't work with 5.0+. So you have to rewrite the output portions of the program to remove the screen manipulation. Or you can find a graphics package you like and rewrite the output sections.
The 3 Laws of the Procrastination Society:
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
Reply With Quote Quick reply to this message  
Join Date: Aug 2009
Posts: 1
Reputation: noddytoddy is an unknown quantity at this point 
Solved Threads: 1
noddytoddy noddytoddy is offline Offline
Newbie Poster

Re: BGI graphics not supported in windows..

 
-1
  #5
Oct 3rd, 2009
Originally Posted by WaltP View Post
BGI graphics was designed for earlier Borland compilers and won't work with 5.0+. So you have to rewrite the output portions of the program to remove the screen manipulation. Or you can find a graphics package you like and rewrite the output sections.
there is a folder named BGI in the directory of Borland C++ 4.5 ,,,however i get the same problem "BGI graphics not supported under windows"--while compiling my project.....has it anything to do with my operating system ---i am using Windows Vista..??
Last edited by noddytoddy; Oct 3rd, 2009 at 2:24 pm.
Reply With Quote Quick reply to this message  
Join Date: Feb 2004
Posts: 10,031
Reputation: crunchie is a splendid one to behold crunchie is a splendid one to behold crunchie is a splendid one to behold crunchie is a splendid one to behold crunchie is a splendid one to behold crunchie is a splendid one to behold crunchie is a splendid one to behold 
Solved Threads: 761
Moderator
Featured Poster
crunchie's Avatar
crunchie crunchie is offline Offline
Spyware Killer

Re: BGI graphics not supported in windows..

 
1
  #6
Oct 3rd, 2009
You would be better served by starting a new thread as this one is over 2 years old
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 16,212
Reputation: jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all 
Solved Threads: 538
Moderator
Featured Poster
jbennet's Avatar
jbennet jbennet is offline Offline
Moderator

Re: BGI graphics not supported in windows..

 
-6
  #7
Oct 3rd, 2009
Originally Posted by noddytoddy View Post
there is a folder named BGI in the directory of Borland C++ 4.5 ,,,however i get the same problem "BGI graphics not supported under windows"--while compiling my project.....has it anything to do with my operating system ---i am using Windows Vista..??
Yes. You are using a 15 year old compiler! That compiler doesnt support windows NT.

Borland C++ 4.52 - (1995) Official support for Windows 95, OWL 2.5

Borland C++ 5.0 - (1996, Windows 95) Released in March 1996. Works on Windows 95 and Windows NT 3.51. It does not (officially) work on Windows NT 4.0 (which was still in development at that time). 3rd party tests exhibited some problems on NT 4.0. It does not work in Windows 3.x or DOS. Despite that, it can produce either Win32, Win16 or DOS programs.

Borland C++ 5.02 - (1997) Final release of the Borland C++ IDE (subsequently replaced up by the C++Builder series), final release to support compilation to (real-mode) MS-DOS target. Windows NT 4.0 officially supported.
Last edited by jbennet; Oct 3rd, 2009 at 11:11 pm.
If i am helpful, please give me reputation points.
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 12
Reputation: akmaahamed_2005 is an unknown quantity at this point 
Solved Threads: 0
akmaahamed_2005's Avatar
akmaahamed_2005 akmaahamed_2005 is offline Offline
Newbie Poster
 
0
  #8
32 Days Ago
BGI graphics was designed for earlier Borland compilers and won't work with 5.0+. So you have to rewrite the output portions of the program to remove the screen manipulation. Or you can find a graphics package you like and rewrite the output sections.
Originally Posted by jbennet View Post
Yes. You are using a 15 year old compiler! That compiler doesnt support windows NT.
Hmmm... So BGI graphics is not meant for this version of the compiler.

I guess that pretty much clears the issue for me now.. though I abandoned my attempts looooooooooong time back...

and to the others who replied earlier, SO SORRY for not noticing your replies back then, I am not sure why I didn't check up on this thread at all. sorry again!!
Last edited by akmaahamed_2005; 32 Days Ago at 6:44 pm.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC