 |
04-09-2008, 08:51 PM
|
#1 (permalink)
|
|
Right Off the Assembly Line
Join Date: Jul 2008
Posts: 3
|
no output for graphics program
i don't get any output for even a simple program like drawing a line (i even tried the default example program in graphics)
whenever i run the program a blank screen appears
i have checked BGI files and all the required files are found...but still the problem persists
i get output for normal C programs(without graphics)
please please help me at the earliest
|
|
|
|
Advertisements. Register and be a member of the community to get rid of them.
|
|
Advertisement
|
|
04-09-2008, 10:26 PM
|
#2 (permalink)
|
|
Broken In
Join Date: Sep 2006
Posts: 147
|
Re: no output for graphics program
reinstall turbo c and try again.why dont you submit your program here.
this might help u
simplest c graphics program
__________________
techtricks.co.in
portforwarding
xp-vista crossover connection
installing xp on vista notebooks
|
|
|
04-09-2008, 11:19 PM
|
#3 (permalink)
|
|
Wise Old Owl
Join Date: Jun 2007
Location: Kochi
Posts: 1,119
|
Re: no output for graphics program
check whether EGAVGA.BGI file is present...
__________________
j1n M@tt || "a guy who gets off bed only b'coz of technology..."
|
|
|
04-09-2008, 11:23 PM
|
#4 (permalink)
|
|
Simply a DIGITian
Join Date: Nov 2007
Location: Kolkata
Posts: 2,942
|
Re: no output for graphics program
Posted by: sreenidhi88
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
int main()
{
int gd=DETECT,gm;
clrscr();
initgraph(&gd,&gm,"C:\\TC\\BGI");
circle(10,20,30);
getch();
}
i think u havn't enabled ur graphics library.............
do it frm
OPTIONS>LINKER>LIBRARY and check GRAPHICS LIBRARY option thr...........
if u do not enable GRAPHICS LIBRARY.............none of ur graphics prog will work......!!!!!!!!
__________________
- Read The Forum RULES First.
- Before PM'ing Or Asking Any Questions To Any Mod Read The FAQ's
- Before Starting A New Thread Read The STICKY THREADS First
- Before Participating In Bazaar Section Read The BAZAAR RULES
|
|
|
05-09-2008, 02:32 PM
|
#5 (permalink)
|
|
Right Off the Assembly Line
Join Date: Jul 2008
Posts: 3
|
Re: no output for graphics program
buddy i have enabled the graphics library but still there is no output only a blank screen only appears
i'm posting the program as u said
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#include<graphics.h>
void main()
{
int gdriver = DETECT, gmode, errorcode;
initgraph(&gdriver, &gmode, " ");
setcolor(2);
line(100,200,250,200);
closegraph();
getch();
}
i tried this one also
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#include<graphics.h>
void main()
{
int gdriver = DETECT, gmode, errorcode;
initgraph(&gdriver, &gmode, "C:\TC\BGI ");
setcolor(2);
line(100,200,250,200);
closegraph();
getch();
}
|
|
|
05-09-2008, 08:37 PM
|
#6 (permalink)
|
|
Broken In
Join Date: Sep 2006
Posts: 147
|
Re: no output for graphics program
Quote:
Originally Posted by ebindraj
buddy i have enabled the graphics library but still there is no output only a blank screen only appears
i'm posting the program as u said
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#include<graphics.h>
void main()
{
int gdriver = DETECT, gmode, errorcode;
initgraph(&gdriver, &gmode, " ");
setcolor(2);
line(100,200,250,200);
closegraph();
getch();
}
i tried this one also
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#include<graphics.h>
void main()
{
int gdriver = DETECT, gmode, errorcode;
initgraph(&gdriver, &gmode, "C:\TC\BGI ");
setcolor(2);
line(100,200,250,200);
closegraph();
getch();
}
|
i think you didnt read the link i gave.if c:\tc\bgi doesnt work try c:\\tc\\bgi.
__________________
techtricks.co.in
portforwarding
xp-vista crossover connection
installing xp on vista notebooks
|
|
|
05-09-2008, 11:03 PM
|
#7 (permalink)
|
|
Simply a DIGITian
Join Date: Nov 2007
Location: Kolkata
Posts: 2,942
|
Re: no output for graphics program
yup sreenidhi88 is rite........
"c:\tc\bgi doesnt work try c:\\tc\\bgi."
"c:\\tc\\bgi\\"
__________________
- Read The Forum RULES First.
- Before PM'ing Or Asking Any Questions To Any Mod Read The FAQ's
- Before Starting A New Thread Read The STICKY THREADS First
- Before Participating In Bazaar Section Read The BAZAAR RULES
Last edited by krishnandu.sarkar; 05-09-2008 at 11:05 PM.
Reason: Automerged Doublepost
|
|
|
05-09-2008, 11:36 PM
|
#8 (permalink)
|
|
Wise Old Owl
Join Date: Jun 2007
Location: Kochi
Posts: 1,119
|
Re: no output for graphics program
"c:\\tc\\bgi" will work.....or copy all necessary bgi files to the 'bin' directory of TC, or to the location where the C pgms r saved.
__________________
j1n M@tt || "a guy who gets off bed only b'coz of technology..."
|
|
|
07-09-2008, 02:52 PM
|
#9 (permalink)
|
|
Right Off the Assembly Line
Join Date: Jul 2008
Posts: 3
|
Re: no output for graphics program
Buddy as u told me i copied all BGI files to BIN ..but stll no output comes only a blinking cursor is seen
this is the pgm ....
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#include<graphics.h>
void main()
{
int gdriver = DETECT, gmode, errorcode;
initgraph(&gdriver, &gmode, "C:\\TC\\BGI ");//(i tried C:\\TC\\BIN also)
setcolor(2);
line(100,200,250,200);
closegraph();
getch();
}
|
|
|
07-09-2008, 09:55 PM
|
#10 (permalink)
|
|
Broken In
Join Date: Sep 2006
Posts: 147
|
Re: no output for graphics program
no need of this step (i tried C:\\TC\\BIN also)
come back to C:\\TC\\BGI
dude you have any idea what closegraph() does??
and does it make any sense to call it before getch()??
your graphics program is working as expected.
use C:\\TC\\BGI itself
just thinkover once again about the sequence in which you call closegraph and getch()  

Quote:
Originally Posted by krishnandu.sarkar
i think u havn't enabled ur graphics library.............
do it frm
OPTIONS>LINKER>LIBRARY and check GRAPHICS LIBRARY option thr...........
if u do not enable GRAPHICS LIBRARY.............none of ur graphics prog will work......!!!!!!!!
|
isnt graphics nabled by default??
Quote:
Originally Posted by krishnandu.sarkar
i think u havn't enabled ur graphics library.............
do it frm
OPTIONS>LINKER>LIBRARY and check GRAPHICS LIBRARY option thr...........
if u do not enable GRAPHICS LIBRARY.............none of ur graphics prog will work......!!!!!!!!
|
isnt graphics nabled by default??
__________________
techtricks.co.in
portforwarding
xp-vista crossover connection
installing xp on vista notebooks
Last edited by sreenidhi88; 07-09-2008 at 10:01 PM.
Reason: Automerged Doublepost
|
|
|
07-09-2008, 10:02 PM
|
#11 (permalink)
|
|
God of Mistakes...
Join Date: Dec 2005
Location: Pune, Maharashtra
Posts: 1,923
|
Re: no output for graphics program
lol...
dude... call getch() before closegraph().
|
|
|
07-09-2008, 10:08 PM
|
#12 (permalink)
|
|
Wahahaha~!
Join Date: Dec 2006
Location: Pune/there
Posts: 7,676
|
Re: no output for graphics program
hahaha...lolz
btw TC sucks
|
|
|
07-09-2008, 11:11 PM
|
#13 (permalink)
|
|
prasath->loves(APPLE);
Join Date: Jul 2008
Location: Trichy, TamilNadu
Posts: 231
|
Re: no output for graphics program
I tried ur prg in VC++ 2008 Express, but it looks like it doesn't support BGI graphics like TC( no "graphics.h" header file in the "C:\Program Files\Microsoft Visual Studio 9.0\VC\include" dir ). Currently i don have any other compiler installed on my PC, tommorow i'll try it on my friend's PC and post my solution.
Quote:
Originally Posted by T159
btw TC sucks
|
Although, I also suggest Dev-C++ and VC++ 2008 Express Edition compilers, TC is the best choice for Simple programming.
__________________
My Desktop Spec:- :-)
AMD Athlon 64 X2 3600+
ASUS M2N-MX Motherboard
2GB DDR2 RAM
500GB Seagate HDD
My Laptop Spec:- :)
BRAND: TOSHIBA
MODEL: C640-X4012
2nd Gen Intel Core i5 2430M
4GB DDR3 RAM
500GB HDD
Last edited by prasath_digit; 07-09-2008 at 11:14 PM.
Reason: Automerged Doublepost
|
|
|
08-09-2008, 03:07 AM
|
#14 (permalink)
|
|
Commander in Chief
Join Date: Jul 2005
Posts: 6,658
|
Re: no output for graphics program
Its not about the tool, its about the compiler that drives it and no matter how simple the code is, a compiler warning is always to be listened to, and errors cleared.
__________________
Harsh J
www.harshj.com
|
|
|
08-09-2008, 08:59 AM
|
#15 (permalink)
|
|
18 Till I Die............
Join Date: Jul 2004
Location: India, Mumbai, Marine Lines
Posts: 5,792
|
Re: no output for graphics program
Quote:
Originally Posted by QwertyManiac
a compiler warning is always to be listened to, and errors cleared.
|
lol
__________________
http://www.bash.org/?258908
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|