Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > C++ Programming
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
C++ Programming General discussions for the C++ language. For questions specific to Microsoft's Visual C++ variant, see the Visual C++ forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C++ Programming section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 4th, 2005, 07:01 AM
Registered User
Join Date: Aug 2005
Location: Warsaw, , Poland.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default graphics in C++

I have problem connected with activete library (graphics.h)
under rhide (compilator C++). I set in motion programm with
help and are problems (BGI graphics not ANSI compatible) and
not identifity functions contents in this library. My programm:

#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>

int main(void)
   /* request auto detection */
   int gdriver = DETECT, gmode, errorcode;
   int xmax, ymax;

   /* initialize graphics and local variables */
   initgraph(&gdriver, &gmode, "");

   /* read result of initialization */
   errorcode = graphresult();
   /* an error occurred */
   if (errorcode != grOk)
      printf("Graphics error: %s\n", grapherrormsg(errorcode));
      printf("Press any key to halt:");

   xmax = getmaxx();
   ymax = getmaxy();

   /* draw a diagonal line */
   line(0, 0, xmax, ymax);

   /* clean up */
   return 0;
(*)Where is error?

Reply With Quote
  #2 (permalink)  
Old November 6th, 2005, 09:10 PM
Authorized User
Join Date: Nov 2005
Location: Chennai, Tamil Nadu, India.
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Paramesh

Your error message itself says this:
"BGI graphics not ANSI compatible"

The graphics you used is not a standard C/c++ code. It is not ANSI or ISO code.

You can try compiling it in Turbo C++ instead.


"Don't walk behind me; I may not lead.
 Don't walk in front of me; I may not follow.
 Just walk beside me and be my friend."
Reply With Quote
  #3 (permalink)  
Old November 28th, 2005, 12:02 AM
Authorized User
Join Date: Nov 2005
Location: , , India.
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts

you should need to specify the default path or path where egavga.bgi file exist...for example
initgraph(&gdriver, &gmode, "\\tc\\bgi");

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
c/c++ graphics hafizmuhammadmushtaq C++ Programming 0 October 19th, 2007 11:33 PM
graphics in c++ himutg C++ Programming 1 December 12th, 2006 08:22 AM
Help on graphics steparths C++ Programming 0 June 30th, 2006 02:09 PM
Graphics Control Dataman Access 2 March 5th, 2004 03:48 PM

All times are GMT -4. The time now is 02:28 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.