Pages

Wednesday, September 12, 2012

Graphics Program Run Problem in Turbo C++ v3

PROBLEM TO RUN GRAPHICS PROGRAM 

IN TURBO C++ V3.

 

My Turbo C++ v3.0 Supported graphics programming. But Sometime graphics program not run in This version. Most of the student use Turbo C++ .v3 for School / collage C, C++, Graphics program in C/C++. Try this simple graphics programing.

Open Turbo C++ editor and write down the code :

#include
#include

void main()
{
    int gd=DETECT, gm;

    initgraph(&gd, &gm,"");
    circle(320,240,50);

    getch();
    closegraph();
}


 Press ctrl + F9 to run the program. But Linker Error Occer. Program is correct. But program not run. 

 
By using 2 Small step you can solved it.

STEP 1 : 

when you do compile and link program - Linker Error: Undefined symbol _initgraph in module 


It means that you have not enabled the graphics library for linking. By default this setting is OFF when you install Turbo C++ version 3.0.





All you need to do is, from turbo c++ menu, goto Options -> Linker -> Libraries... and check the Graphics Library option -> Click OK.

STEP 2 :
After Done the process  linker problem not Occer.Program Compile Properly. No Error Occer. But Program not run.

Now Go to TC folder From windows Explorer.  Double Click on “BGI” folder Copy the file “ EGAVGA.BGI ” and paste the File on “BIN” Folder.

Now Run The Program.