#include<iostream.h>
#include<conio.h>
#include<graphics.h>
#include<dos.h>
void main()
{
int x=170,i,gdriver=DETECT,gmode;
initgraph(&gdriver,&gmode,”c:\tc\bgi”);
settextstyle(DEFAULT_FONT,HORIZ_DIR,2);
outtextxy(170,180,”LOADING,PLEASE WAIT”);
for(i=0;i<300;++i)
{
delay(30);
line(x,200,x,220);
x++;
}
getch();
closegraph();
}
error found
BGI ERROR : graphics not initialized (use initgraph)
bro how to remove this error :S
There is only one way to fix that error.
Learn OpenGL.
sir linking error show kr rha ha isa kysa remove kra
There is no need to learn OpenGL ..
because….the problem is with your code
try this-
initgraph(&gdriver,&gmode,"_____");
just put the path to BGI folder in place of _____
or if you have Turbo c++ by Neutron then you can use this –
initgraph(&gd,&gm,"C:\Turboc3\BGI");
this will help you
Where do I get the bgi folder???
Go to your Turbo c++ folder in C:/ directory. Then go to Disk>TurboC3>BGI. Sorry for the late comment. I have posed the solution way back in 2014. Hope it still helps š
Go from initgraph.
Use :initgraph (&gdriver,&gmode,”c:\tc\bgi”);
cannot find iostream.h and graphic.h, microsoft visual studio 2010….
In function initgraph(&gdriver,&gmode,"c:tcbgi"); , you have the path for graphic driver <"c:tcbgi">. Correct the graphic driver.
Make sure "c:tcbgi" is pointing to the right directory
No need to that just type “”
This program generates linker error every time I use it it does no opens
This program works in turbo c++, which compiler you are using?
program nt working…..plzz give a solution
what problem you are getting?
What is your issue .
Good job!
if i make Borland, how run it?
error on . using c++ 5.11
no errors….no warnings….. bt also o/p nt cuming š
Show me the exact code that your are executing.
This is my code… which I am running..
#include
#include
#include
#include
void main()
{
int x=170,i,gdriver=DETECT,gmode;
initgraph(&gdriver,&gmode,”C:\TURBOC3\BGI”);
settextstyle(DEFAULT_FONT,HORIZ_DIR,2);
outtextxy(170,180,”LOADING,PLEASE WAIT”);
for(i=0;i<300;++i)
{
delay(30);
line(x,200,x,220);
x++;
}
getch();
closegraph();
}
Error: BGI ERROR : graphics not initialized (use initgraph)
P.s. My BGI location is correct.
Add. int DEAFAULT_FONT;
it will work.
The program isn’t giving any output.Could you please let me know what to do.
which compiler you are using? it will work in turbo c++ only.
3.2 turbo c++
Hey i want to make a square bar which changes color when that bar is called….. Can anyone help
its not running
ill try to run it but it will not go to the output but it doesnt said that i have any errors what should i do
Sir what is prototype of intigraph…
Help… Ive messed up somewhere and can’t get up
IDE:
Borland C++ 5.02 fresh install
code:
#include
#include
#include
#include
void main()
{
int x=170,i,gdriver=DETECT,gmode;
initgraph(&gdriver,&gmode,āc:\bc5\bgiā);
settextstyle(DEFAULT_FONT,HORIZ_DIR,2);
outtextxy(170,180,āLOADING,PLEASE WAITā);
for(i=0;i<300;++i)
{
delay(30);
line(x,200,x,220);
x++;
}
getch();
closegraph();
}
message:
Transferring to C:\bc5\bin\tlink.exe @c:\bc5\bin\proj0001.r$p
! (1, 1): Undefined symbol _closegraph in moule proj0001.cpp
! (1, 1): Undefined symbol _line in moule proj0001.cpp
! (1, 1): Undefined symbol _outtextxy in moule proj0001.cpp
! (1, 1): Undefined symbol _settextsyle in moule proj0001.cpp
! (1, 1): Undefined symbol initgraph in moule proj0001.cpp
“default_fault” is showing undefined symbol
EVERYBODY MUST BE AWARE THAT THIS EXAMPLE IS FOR TURBO/BORLAND C++ (till version 3.1 only). ANY OTHER C++ (Visual C++ OR C++ Builder) ARE NOT GOING TO WORK.
I use Dev C++ compiler. I use looping statements to do this.
#include
using namespace std;
int main()
{
char x=219;/*ASCII value for block*/
int i=0,j=0,k=0,l=0,m=0;
cout<<" ______________________________________\n";
cout<<"Loading data ";
while(i<100000)
i–;
cout<<x<<x<<x<<x;
while(j<0)
j–;
cout<<x<<x<<x<<x;
while(k<100000000)
k–;
cout<<x<<x;
while(l=0)
l–;
cout<<x<<x<<x<<x<<x<<x<<x<<x;
while(m<100000)
m–;
cout<<x<<x<<x<<x;
while(m<1000)
m–;
cout<<x<<x<<x<<x<<x<<x;
while(l=0)
l–;
cout<<x<<x<<x<<x<<x<<x<<x<<x<<x<<x<<"\n\n";
return 0;
}