Thread: graphics.h link error

  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,708
    #include <conio.c> /// ??? Does That Work?
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  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 int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    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.

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, 03:07 AM
  2. Testing some code, lots of errors...
    By Sparrowhawk in forum C Programming
    Replies: 48
    Last Post: 12-15-2008, 04:09 AM
  3. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 05:45 PM
  4. DX - CreateDevice - D3DERR_INVALIDCALL
    By Tonto in forum Game Programming
    Replies: 3
    Last Post: 12-01-2006, 07: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