| | |
BGI graphics not supported in windows..
Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved |
hi!
i tried to run the following program in BORLAND C++ version 5.02..
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..
i tried to run the following program in BORLAND C++ version 5.02..
C++ Syntax (Toggle Plain Text)
#include<stdio.h> #include<graphics.h> #include<string.h> #include<math.h> #include<conio.h> int const monthcount=12,dataoffset=18; struct indata { float realarray[ 12]; float array[ 12]; }; char getlabel[3]; indata data; int monthplace[ 12]; float interval,chartbottom,radius; struct wcp { float x; float y; } coord[monthcount]; wcp center; int round(float a) { int b; b=a; if(a-b>0.5) return ++b; else return b; } void polyline(int x, wcp *y) { for(int i=0;i<x-1 ;i++) line(y[i].x,y[i].y,y[i+1].x,y[i+1].y); } void getlab(int x) { switch(x) { case 0: { strcpy(getlabel,"JAN"); break; } case 1: { strcpy(getlabel ,"FEB"); break; } case 2: { strcpy(getlabel," MAR"); break; } case 3: { strcpy(getlabel,"APR"); break; } case 4: { strcpy(getlabel,"MAY"); break; } case 5: { strcpy(getlabel,"JUN"); break; } case 6: { strcpy(getlabel,"JUL"); break; } case 7: { strcpy(getlabel,"AUG" ); break; } case 8: { strcpy(getlabel,"SEP"); break; } case 9: { strcpy(getlabel,"OCT"); break; } case 10: { strcpy(getlabel,"NOV"); break; } case 11: { strcpy(getlabel,"DEC"); break; } } } void getdata() { float t1=0.00,t2; for(int t=0;t<12;t++) { getlab(t); printf("ENTER THE DATA FOR THE MONTH OF %s: ",getlabel); scanf("%f",&data.realarray[t]); if(data.realarray[t]>t1 ) { t1=data.realarray[t]; } } for(t=0;t<12;t++) { t2=data.realarray[t]/t1; data.array[t]=t2*400; } } void puttext(wcp textp) { settextstyle(1,HORIZ_DIR,1); outtextxy(textp.x,textp.y,getlabel); } void drawlabels() { wcp textposition; textposition.y=chartbottom; int zz=25; for(int az=0;az<12;az++) { textposition.x=zz; zz+=50; getlab(az); puttext(textposition); } } char valuep[5]; void findvaluep(int x) { int y=x,ttt; char tg[5]; strcpy(tg,""); do { ttt=y%10; switch(ttt) { case 0: { strcat(tg,"0"); break; } case 1: { strcat(tg,"1"); break; } case 2: { strcat(tg,"2"); break; } case 3: { strcat(tg,"3"); break; } case 4: { strcat(tg,"4"); break; } case 5: { strcat(tg,"5"); break; } case 6: { strcat(tg,"6"); break; } case 7: { strcat(tg,"7"); break; } case 8: { strcat(tg,"8"); break; } case 9: { strcat(tg,"9"); break; } } y/=10; } while(y>0); strcpy(valuep,""); for(y=0;y<strlen(tg);y++) { valuep[y]=tg[strlen(tg)-y-1]; } valuep[y]=NULL; } void linechart() { drawlabels(); settextstyle(DEFAULT_FONT,HORIZ_DIR,1); for(int t=0;t<monthcount;t++) { coord[t].x=monthplace[t]; coord[t].y=450-data.array[t]-dataoffset; findvaluep(data.realarray[t]); outtextxy(coord[t].x,coord[t].y-10,valuep); } polyline(monthcount,coord); } void main() { int gdriver=DETECT,gmode; initgraph(&gdriver,&gmode,""); getdata(); cleardevice(); chartbottom=450.0; interval=50.0; monthplace[0]=25; for(int z=1;z<monthcount;z++) monthplace[z]=monthplace[z-1 ]+interval; linechart(); getch(); cleardevice(); closegraph(); }
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..
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.
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
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
•
•
Join Date: Aug 2009
Posts: 1
Reputation:
Solved Threads: 1
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.
You would be better served by starting a new thread as this one is over 2 years old
•
•
•
•
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..??
•
•
•
•
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.
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.
•
•
•
•
Yes. You are using a 15 year old compiler! That compiler doesnt support windows NT.
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.
![]() |
Similar Threads
- Graphics.h turmoil (Game Development)
- Bgi Graphics Don't Work On Windows... Why??? (Game Development)
Other Threads in the C++ Forum
- Previous Thread: Array rotate in wrong way
- Next Thread: Why is C++ so big?
| Thread Tools | Search this Thread |
api array arrays based binary c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count database delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game generator givemetehcodez google graph gui homeworkhelp iamthwee ifstream input int java lib linkedlist linker list loop looping loops map math matrix memory multiple news number numbertoword output pointer problem program programming project python random read recursion recursive reference rpg sorting string strings temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets






