graphics.h link error

This is a discussion on graphics.h link error within the C Programming forums, part of the General Programming Boards category; Hello all, Im wondering if theres a guru out there that can figure this one out? I must admit I ...

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    15

    Talking graphics.h link error

    Hello all,
    Im wondering if theres a guru out there that can figure this one out? I must admit I just pulled the last hair out of my head so im going else where? below is the problem

    My code is

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

    void
    main (void)
    {
    int driver, mode;


    initgraph (&driver, &mode, "c:/graphics/graphics");

    setbkcolor (1);
    setcolor (4);
    settextstyle (4, 0, 14);
    outtext ("Graphics Test!!!!");
    getche();
    closegraph();
    }

    This will compile just fine but when i go to wright the .exe i am getting the following link error. I would appreciate the help!!

    Linking...
    gtest.obj : error LNK2001: unresolved external symbol _closegraph
    gtest.obj : error LNK2001: unresolved external symbol _outtext
    gtest.obj : error LNK2001: unresolved external symbol _settextstyle
    gtest.obj : error LNK2001: unresolved external symbol _setcolor
    gtest.obj : error LNK2001: unresolved external symbol _setbkcolor
    gtest.obj : error LNK2001: unresolved external symbol _initgraph
    Debug/gtest.exe : fatal error LNK1120: 6 unresolved externals
    Error executing link.exe.

    gtest.exe - 7 error(s), 0 warning(s)


    Again Thx!!!!

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,643
    #include <conio.c> /// ??? Does That Work?
    Code:
    if( numeric_limits< byte >::digits != bits_per_byte )
        error( "program requires bits_per_byte-bit bytes" );
    24bbs.cpp

  3. #3
    Registered User
    Join Date
    Oct 2001
    Posts
    15

    Talking

    Unfortunately no, I have conio.h included for safety sake but still not working Im thinking it has to do with either the internals of my graphics.h or my initgraph statement but I not to sure. Thank you however.

  4. #4
    Registered User
    Join Date
    Feb 2010
    Posts
    1

    ??

    if you're using turbo,
    go to options>linker>libraries>
    then cross the "graphics" option
    it, however showed no graphics error for me but the program did't run
    try it hope you'll have better fate?!
    just try it

  5. #5
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,420
    The compiler was obsolete when this thread was alive - way back in 2001

    Now it's just a farce - closed.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 02:07 AM
  2. Testing some code, lots of errors...
    By Sparrowhawk in forum C Programming
    Replies: 48
    Last Post: 12-15-2008, 03:09 AM
  3. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 04:45 PM
  4. DX - CreateDevice - D3DERR_INVALIDCALL
    By Tonto in forum Game Programming
    Replies: 3
    Last Post: 12-01-2006, 06:17 PM
  5. error: template with C linkage
    By michaels-r in forum C++ Programming
    Replies: 3
    Last Post: 05-17-2006, 08:11 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21