DIGIT-ARC read-only archive · snapshot: July 23, 2026

Turbo CPP 3.0 help

14 posts · originally from https://geek.digit.in/community/threads/turbo-cpp-3-0-help.50748/

morpheusv6
morpheusv6 Original post #1
Feb 26, 2007 at 6:11 PM
I recently installed TCpp 3.0 on my system.
I am intrested in doing a grpahics oriented project in C. But I am unable to use graphics.h. initgraph() does not seem to function!

After typing the following code:

#include<conio.h>
#include<graphics.h>
int main()
{
casanova
Feb 26, 2007 at 11:22 PM
What error do u get?
MysticDews
Feb 26, 2007 at 11:25 PM
Go to the BGI directory,
u ll find the EGAVGA.bgi file there...
just copy it, n place it in the BIN folder or wherever ur source files are created(i mean the EXE files of the codes that u rite, its usually in the BIN folder or the SOURCE folder.)


May be this wud help..
coolsunny
Feb 27, 2007 at 9:15 AM
guys i got error msg after running proogram

Unable to open include file 'STDIO.H'

How to solve this problem?
planetcall
Feb 27, 2007 at 9:34 AM
stdio.h is a library of C programming language. Why not use <iostream> ? EGAVGA is a passe anyway. why not use some standard way out as for example OpenGL or Java2D ? Both have practical usage and are not too tough to begin with. Java2D in particular is easier of two, whereas OpenGL is closer to C++.
casanova
Feb 27, 2007 at 11:21 PM
The link to ur library files is missing. Goto the options>directories and give the path to ur header files. Most probably it shud be ..\tc\include
coolsunny
Feb 28, 2007 at 12:02 AM
thanks,it solved. i installed tc in d drive.but in default directories select c:\tc\include...so the problem.i chaneged it to 'd'.
morpheusv6
Feb 28, 2007 at 7:44 AM
I tried copying the EGAVGA.BGI file into the BIN directory and changed the path to NULL but the same problem continues.:confused:

I do not get any error. The Program just hangs after I get black screen.
casanova
Feb 28, 2007 at 9:23 AM
^^
How do u start ur tc? Dont start it from windows. Go to command prompt. Go to ur tc directory. go to bin directory. Start ur tc from here.
c:\tc\bin>tc
morpheusv6
Mar 1, 2007 at 8:38 PM
casanova said:
^^
How do u start ur tc? Dont start it from windows. Go to command prompt. Go to ur tc directory. go to bin directory. Start ur tc from here.

I do start it from the command prompt. It does not start by double clicking on it.
casanova
casanova #11
Mar 1, 2007 at 10:51 PM
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>

int main(void)
{
/* request auto detection */
int gdriver = DETECT, gmode, errorcode;
clrscr();
/* initialize graphics mode */
initgraph(&gdriver, &gmode, "");

/* read result of initialization */
errorcode = graphresult();

if (errorcode != grOk) /* an error occurred */
{
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1); /* return with error code */
}

/* draw a line */
line(0, 0, getmaxx(), getmaxy());

/* clean up */
getch();
closegraph();
return 0;

}

U did not mention if u start from tc directory or the bin directory. Try the above code to see what the error message is.
::cyborg::
Mar 2, 2007 at 12:02 AM
give me the error msg u get

do u use ctrl+f9
and alt +f5
casanova
casanova #13
Mar 2, 2007 at 12:16 AM
^^
No need to use alt+f5. Instead use a getch() or getchar() at the end.
mediator
mediator #14
Mar 2, 2007 at 3:04 AM
@morpheus :

1. Install tc cleanly/newly again. or if already installed new then do
2. Options>Linker>Libraries>"Check" graphics library.
3. Ur done. Now try compiling!

:)