Results 1 to 19 of 19
-
18-09-2007, 12:40 PM #1
Unable to run graphics program in C..
I am unable to run even a simplest graphics program in C, even though when i compile the program it shows success but when i run it , it gives the error that the
BGI error: graphics not initialized...
I dont know where is the problem...can any one help plz
#include<stdio.h>
#include<conio.h>
#include<graphics.h.
void main()
{
int gd=DETECT,GM;
initgraph(&gd,&gm,"");
setbkcolor(RED);
getch();
}
-
18-09-2007, 01:32 PM #2
Re: Unable to run graphics program in C..
wrong section mate. should be in question n ans section
wat compiler r u usingIf God has indeed created Himself in His own image, then I submit to you that God is a cockroach :mrgreen:!!!!!!!!
-
18-09-2007, 02:00 PM #3
Re: Unable to run graphics program in C..
If the programs compiles with graphics.h included, I think it's Borland compiler.
Originally Posted by fun2sh
--- Console Junkie
-
18-09-2007, 04:24 PM #4
Re: Unable to run graphics program in C..
^^^^
Originally Posted by fun2sh
yah its borland compiler, well , now can u suggest me any clue, why its not running...
-
18-09-2007, 05:01 PM #5
Re: Unable to run graphics program in C..
Post Here
Post your C/C++ Programs Here
To Get Your AnswerPicoVico.Com - SlideShow Maker
-
19-09-2007, 03:20 PM #6
Re: Unable to run graphics program in C..
try giving .cpp extension to the filename and compile it.
Last edited by adi007; 19-09-2007 at 03:25 PM.
☼ doiteasily.com ►easy way(s) to do certain things
Tech Word of the day : ADSL
☼ Aditech Blog ► There is something for everyone
Terminal Command of the day
☼ regtweak.info ► Windows Registry hacks and tricks
-
19-09-2007, 04:20 PM #7
Re: Unable to run graphics program in C..
Do this :
Originally Posted by sauravgr8
ENABLE GRAPHICS BY GOING TO OPTIONS MENU IN TC COMPILER THEN CLICK LINKERS THEN CLICKING [ ]GRAPHICS LIBRARY .DO NOT CHANGE ANY OTHER OPTION.
hope this will help
and plz post ur Questions in QnA section
-
20-09-2007, 01:49 AM #8
Re: Unable to run graphics program in C..
Originally Posted by adi007
I am already using CPP extension , even though its not working
I tried doing this friend, i left rest of the option as intact, and just removed the cross from graphics library as u said, but still the problem persists
Originally Posted by saurabh kakkar
Last edited by sauravgr8; 20-09-2007 at 01:49 AM. Reason: Automerged Doublepost
-
20-09-2007, 02:40 PM #9
Re: Unable to run graphics program in C..
are sorry dont remove the cross instead run this program :
Originally Posted by sauravgr8
Problems in ur programCode:#include<stdio.h> #include<conio.h> #include<graphics.h> void main() { int gd=DETECT,gm; initgraph(&gd,&gm,"c:\\tc\\bgi"); setbkcolor(RED); getch(); }
#include<stdio.h>
#include<conio.h>
#include<graphics.h.<----------should be #include<graphics.h>
void main()
{
int gd=DETECT,GM;<-----------should be gm i.e in small
initgraph(&gd,&gm,"");
setbkcolor(RED);
getch();
}
hope this will help
-
20-09-2007, 07:50 PM #10
Re: Unable to run graphics program in C..
replace this line wit.......initgraph(&gd,&gm,"..\\bgi");
Originally Posted by sauravgr8
it might workAt any moment of time, the BEST thing to do is the RIGHT thing, the NEXT BEST thing is the WRONG thing, and the WORST thing to do is NOTHING
-
20-09-2007, 08:58 PM #11
Re: Unable to run graphics program in C..
Search turbo c/c++ help before drawing out conclusion.
U could hav find the answers if u hav right clicked on graphics.h, then would hav scrolled right to the bottom to see some examples, copy the driver initiaiization part from any of the exaples and give the address of bgi directory. e.g. if ur tc is in c: drive then give
c:\\tc\\bgi
as the path
-
20-09-2007, 10:01 PM #12
Re: Unable to run graphics program in C..
+1.This worked fr me.
Originally Posted by gofeddy
Stealing your women and horses since 1843.
-
20-09-2007, 10:12 PM #13
-
21-09-2007, 12:51 PM #14
Re: Unable to run graphics program in C..
Originally Posted by saurabh kakkar
Sorry , it was just a typing mistake here, but in the borland C i did the way u said ...but still it was not working , i tried all the remedies, even gave the path within that inverted commas, but still its not working...what should i do know...
-
21-09-2007, 10:23 PM #15
Re: Unable to run graphics program in C..
there is no problem in My program i have executed it in TURBO C++
Originally Posted by sauravgr8
all i can suggest to is to Dump Borland compiler and use TURBO C++
if u r not able to find TURBO C++ i can upload it for u
-
21-09-2007, 10:59 PM #16
Re: Unable to run graphics program in C..
^^ Oi... Turbo C/C++ is an IDE (Integrated Development Environment) that uses Borland's C/C++ compiler.
--- Console Junkie
-
22-09-2007, 07:55 PM #17
Re: Unable to run graphics program in C..
thanks man for the info i was confused i was also thinking that both r same
thing
@ sauravgr8 : plz provide the error that u r getting
-
23-09-2007, 12:32 AM #18
Re: Unable to run graphics program in C..
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
void main()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,"C:/TC/BIN");
setbkcolor(RED);
getch();
}
this is the program i typed in and saved with .c extension
now when i compile it shows success
but wheni i run it gives an error
UNABLE TO OPEN " TCCLASS.LIB"
now what should i do
-
23-09-2007, 01:20 AM #19
Re: Unable to run graphics program in C..
^^ I have uploaded my Tc compiler extract it using winrar and then install
By clicking on
INSTALL.EXE then chose the location where u want ur Tc folder then press y on each Q asked
then When done !! comes instalation is complete
then ENABLE GRAPHICS BY GOING TO OPTIONS MENU IN TC COMPILER THEN CLICK LINKERS THEN
CLICKING [X]GRAPHICS LIBRARY . do not remove the [X] if it already exists
File: C++.rar
DownloadLink: http://rapidshare.com/files/57529675/C__.rar
then run ur Program this time it shud Run
Last edited by saurabh kakkar; 23-09-2007 at 01:31 AM.
LinkBacks (?)
-
11-06-2011, 01:31 PM
Similar Threads
-
Unable to Start a Program with an .exe File Extension
By Rockstar11 in forum TutorialsReplies: 2Last Post: 09-05-2009, 10:24 PM -
no output for graphics program
By ebindraj in forum ProgrammingReplies: 14Last Post: 08-09-2008, 08:59 AM -
Graphics program in C
By zegulas in forum ProgrammingReplies: 1Last Post: 29-08-2008, 12:00 PM -
Unable to run graphics program in C..
By sauravgr8 in forum TutorialsReplies: 18Last Post: 23-09-2007, 01:20 AM -
new program in 'close program menu' list and more.......
By vishakadatta in forum QnA (read only)Replies: 2Last Post: 12-04-2005, 11:33 PM


LinkBack URL
About LinkBacks

Bookmarks