Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 04-09-2008, 08:51 PM   #1 (permalink)
Right Off the Assembly Line
 
Join Date: Jul 2008
Posts: 3
Default 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
ebindraj is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 04-09-2008, 10:26 PM   #2 (permalink)
Broken In
 
Join Date: Sep 2006
Posts: 147
Default 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
sreenidhi88 is offline  
Old 04-09-2008, 11:19 PM   #3 (permalink)
Wise Old Owl
 
j1n M@tt's Avatar
 
Join Date: Jun 2007
Location: Kochi
Posts: 1,119
Default 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..."
j1n M@tt is offline  
Old 04-09-2008, 11:23 PM   #4 (permalink)
Simply a DIGITian
 
krishnandu.sarkar's Avatar
 
Join Date: Nov 2007
Location: Kolkata
Posts: 2,942
Default 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
krishnandu.sarkar is offline  
Old 05-09-2008, 02:32 PM   #5 (permalink)
Right Off the Assembly Line
 
Join Date: Jul 2008
Posts: 3
Default 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();
}

ebindraj is offline  
Old 05-09-2008, 08:37 PM   #6 (permalink)
Broken In
 
Join Date: Sep 2006
Posts: 147
Default Re: no output for graphics program

Quote:
Originally Posted by ebindraj View Post
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
sreenidhi88 is offline  
Old 05-09-2008, 11:03 PM   #7 (permalink)
Simply a DIGITian
 
krishnandu.sarkar's Avatar
 
Join Date: Nov 2007
Location: Kolkata
Posts: 2,942
Default 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
krishnandu.sarkar is offline  
Old 05-09-2008, 11:36 PM   #8 (permalink)
Wise Old Owl
 
j1n M@tt's Avatar
 
Join Date: Jun 2007
Location: Kochi
Posts: 1,119
Default 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..."
j1n M@tt is offline  
Old 07-09-2008, 02:52 PM   #9 (permalink)
Right Off the Assembly Line
 
Join Date: Jul 2008
Posts: 3
Default 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();
}
ebindraj is offline  
Old 07-09-2008, 09:55 PM   #10 (permalink)
Broken In
 
Join Date: Sep 2006
Posts: 147
Default Re: no output for graphics program

Quote:
Originally Posted by ebindraj View Post
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();
}

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 View Post


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 View Post


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
sreenidhi88 is offline  
Old 07-09-2008, 10:02 PM   #11 (permalink)
God of Mistakes...
 
Garbage's Avatar
 
Join Date: Dec 2005
Location: Pune, Maharashtra
Posts: 1,923
Default Re: no output for graphics program

lol...

dude... call getch() before closegraph().
__________________
Registered Linux User #468778
----------------------------------
http://twitter.com/_Garbage_
Garbage is offline  
Old 07-09-2008, 10:08 PM   #12 (permalink)
Wahahaha~!
 
Faun's Avatar
 
Join Date: Dec 2006
Location: Pune/there
Posts: 7,676
Default Re: no output for graphics program

hahaha...lolz

btw TC sucks
__________________
Blog | Flickr | Battlelog
Spoiler:
Asus Z68 V-Pro|i5 2500k|TRUE Black|Ripjaws X|U2311H|N560GTX|D7000|XONAR STX|RE272|RE0|CC51|XE200PRO Walnut| TD II V2| Ultraphile|N5800

Mono
Faun is offline  
Old 07-09-2008, 11:11 PM   #13 (permalink)
prasath->loves(APPLE);
 
prasath_digit's Avatar
 
Join Date: Jul 2008
Location: Trichy, TamilNadu
Posts: 231
Smile 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 View Post
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
prasath_digit is offline  
Old 08-09-2008, 03:07 AM   #14 (permalink)
Commander in Chief
 
QwertyManiac's Avatar
 
Join Date: Jul 2005
Posts: 6,658
Default 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
QwertyManiac is offline  
Old 08-09-2008, 08:59 AM   #15 (permalink)
18 Till I Die............
 
Join Date: Jul 2004
Location: India, Mumbai, Marine Lines
Posts: 5,792
Default Re: no output for graphics program

Quote:
Originally Posted by QwertyManiac View Post
a compiler warning is always to be listened to, and errors cleared.
lol
__________________
http://www.bash.org/?258908
mehulved is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Graphics program in C zegulas Programming 1 29-08-2008 12:00 PM
Find the output of this program...only a few lines sarincv Programming 4 26-11-2007 10:13 PM
Unable to run graphics program in C.. sauravgr8 Programming 18 23-09-2007 01:20 AM
Video output to tv from graphics card princedmedia Graphic cards 5 05-06-2007 01:26 PM
Does Integrated graphics mobo support DVI output pulkit101 Graphic cards 10 17-12-2006 08:36 AM

 
Latest Threads
- by soumya
- by Sujeet
- by clmlbx
- by Sujeet

Advertisement




All times are GMT +5.5. The time now is 11:11 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2