1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

C++ problem

Discussion in 'C++' started by Carlos, Dec 6, 2008.

  1. Carlos

    Carlos New Member

    Joined:
    Dec 5, 2008
    Messages:
    57
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    none
    hello! Can anyone tell me how can i include graphics.h in Visual C++ language.
    b/c in Turbo C, i use #include "graphics.h" to include graphics in my project.
    but Visual C++ compiler give this error.
    Error 1 fatal error C1083: Cannot open include file: 'graphics.h': No such file or directory
    reply me plz!
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,287
    Likes Received:
    364
    Trophy Points:
    83
    Graphics package of Turbo C is only for BGI graphics and is not a part of Visual C++ compiler and so you would not be able to use BGI graphics in VC++
     
  3. Carlos

    Carlos New Member

    Joined:
    Dec 5, 2008
    Messages:
    57
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    none
    So, how can i include graphics in Visual C++???
     
  4. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,287
    Likes Received:
    364
    Trophy Points:
    83
    It has its own GD library.
     
  5. Carlos

    Carlos New Member

    Joined:
    Dec 5, 2008
    Messages:
    57
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    none
    So how to include that GD library in our program??
    Plz tell me the method
     
  6. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,287
    Likes Received:
    364
    Trophy Points:
    83
    Which VC++ version you are using.
     
  7. Carlos

    Carlos New Member

    Joined:
    Dec 5, 2008
    Messages:
    57
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    none
    I have installed Visual C++ 2005 Express Edition
     
  8. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,287
    Likes Received:
    364
    Trophy Points:
    83
    I am not sure of Express edition if its in built or you may need to download the package and install it.
     
  9. skp819

    skp819 New Member

    Joined:
    Dec 8, 2008
    Messages:
    89
    Likes Received:
    3
    Trophy Points:
    0
    It is simple, in your code you have the line

    #include "graphics.h" or #include <graphics.h>

    But the file graphics.h can not be found by the compiler.

    If you have graphics.h on your computer then you must make sure that the path where it resides is in the include search path.

    This is done through tools->options->projects and solutions->vc++ directories and switch show directories for to include files. Add the path to graphics.h there and then recompile. You must also make sure that any library files are also put into the lib path, this is done by switching show directories for to library files and then putting the path to the library files in there.
     
  10. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,012
    Likes Received:
    203
    Trophy Points:
    0
    Occupation:
    Senior Support Engineer
    Location:
    England
    It's not that eay, skp819, the header file probably defines functions that can be found in a graphics library, so you also need to get the library.
     

Share This Page