TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: MATTHEW DUHART
from: PATRICK SUNG
date: 1997-08-10 17:47:00
subject: Problem with initgraph

MD> Yep, it's that graphics library.  But now, I've entered a different
MD> program called CALC.  It's a calculator program of course.  You have to
MD> enter 3 files: CALC.H, CALC.CPP, and CALC_APP.CPP, then a project called
MD> CALC_APP.PRJ containing the 2 .CPP files.  I've entered all three of the
MD> files, did what the book said, and I even had to add a RETURN 0; at the
MD> end of CALC_APP.CPP because there was a warning (function should return
MD> a value, something like that).  Now everything is compiled and
MD> everything is correct (I've have me and other people check the files
MD> over many times).  But when I try to run the .EXE from DOS or Turbo C++
MD> (I used Ctrl+F9, is this wrong, uhhh....) there is a BGI error: graphics
MD> not initialized, use 'initgraph'. But I've already checked the graphics
MD> library and all the stuff that needs to be marked (I marked everything
MD> on [options],[linker, I think],[libraries] except for the TV library).
Hi.
You probably miss the *.BGI files, make sure you have the initgraph() first 
and
it have set to the appropriate path(path that the *.BGI reside). I would
advise you to copy the required BGI file to your working. It is not necessary
to copy all BGI file to your directory, for example, if you are working with
EGA or VGA mode(like 640x480 16 color), you can copy the EGAVGA.BGI to your
program's directory. Then you can initgraph like that:
  initgraph(gd,gm,""); /* path have to use "" even it is null */
I forgot where those BGI files are in but you can find easily and the above
should work.
Bye :>
___
 þ nfx v2.6 [C0000] -Patrick Sung                                           
--- Maximus 3.01
---------------
* Origin: C+Net BBS. Programming & Networking. (1:342/1017)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.