Thread: graphics

  1. #1
    Registered User
    Join Date
    Apr 2002
    Posts
    3

    Question graphics

    I am a beginner in programming with c++.
    I tried to initialize graphics but it isn't working.
    I used initgraph and the compiler returned an error

    #include <graphics.h>
    #include <iostream.h>

    int main()
    {
    int gdriver=DETECT, gmode=0;
    initgraph (&gdriver, &gmode,"");
    return 0;
    }

    --------------------------------------------------------------------------
    undefined simbol initgraph in module -path to the cpp file

  2. #2
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    I haven't done a whole lot of graphics in C++ and so this may not be the solution, but passing the addresses of variables (&) as parameters in a function just doesn't look right to me.

  3. #3
    I'm Back
    Join Date
    Dec 2001
    Posts
    556
    the ( "" ) is the place/path of your graphic files. Yours should be I think in TC\BGI

    Like in most cases it is C:\TC\BGI, so you can put : "C:\\TC\\BGI"

    or else you could copy all the BGI files into your BIN directory and let it reamin as ""
    -

  4. #4
    Registered User
    Join Date
    Apr 2002
    Posts
    3

    Thumbs down graphics

    I tried with the path in ("") -> initgraph(driver,mode, "PATH")
    but the error is still the same.

  5. #5
    "The Oldest Member Here" Xterria's Avatar
    Join Date
    Sep 2001
    Location
    Buffalo, NY
    Posts
    1,039
    Make sure you are using Borland Turbo C++ 3.1

  6. #6
    Registered User
    Join Date
    Sep 2001
    Posts
    305
    or some other borland compiler ..

  7. #7
    Registered User
    Join Date
    Apr 2002
    Posts
    3

    Smile

    I done it. Thanks
    now a new question

    with outtextxy (x, y, "name");
    I put a text on coordinates x,y. now I want to input onother text at the end of the first one and put it in a variable something like cin>> a;

    i tried with gotoxy(); but it isn't working.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Turtle Graphics, how does it work?
    By freddyvorhees in forum C++ Programming
    Replies: 15
    Last Post: 08-28-2009, 09:57 AM
  2. Graphics Programming :: Approach and Books
    By kuphryn in forum Windows Programming
    Replies: 4
    Last Post: 05-11-2004, 08:33 PM
  3. egavga.bgi problem
    By sunil21 in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 09-22-2003, 05:06 PM
  4. Graphics Devices and Cprintf clash
    By etnies in forum C Programming
    Replies: 6
    Last Post: 05-09-2002, 11:14 AM