Turbo CPP 3.0 help

Status
Not open for further replies.

morpheusv6

Journeyman
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()
{
 
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

Journeyman
guys i got error msg after running proogram

Unable to open include file 'STDIO.H'

How to solve this problem?
 

planetcall

Indian by heart
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

The Frozen Nova
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

Journeyman
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'.
 
OP
morpheusv6

morpheusv6

Journeyman
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.
 
OP
morpheusv6

morpheusv6

Journeyman
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

The Frozen Nova
#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.
 

mediator

Technomancer
@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!

:)
 
Status
Not open for further replies.
Top Bottom