Help with a link error

Discussion in 'C' started by Hwciua4i, Sep 29, 2010.

  1. Hwciua4i

    Hwciua4i New Member

    Joined:
    Sep 29, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Hi,

    I'm new to this forum and am just getting used to C++.
    I have this graphics assignment in which I've been given a framework and am to implement a triangle rasterizer.

    The framework includes a given library called by the instructor.
    However, sometimes it compiles just fine and other times I just suddenly get this error:
    LINK : fatal error LNK1181: cannot open input file 'GfxLib.lib' ... after which I am unsure how to continue as it was compiling fine a while back.:thinking:
    I'm using Visual Studio 2010 and the .lib file is located in both the Debug and Release folders.

    Any help on how to solve this error is much appreciated.:happy:
     
  2. cutithongtin

    cutithongtin New Member

    Joined:
    Sep 29, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    hi , this error may be caused by your not referring .lib file in your project . if you are working with VS 2k10 , try these step .
    In solution explorer , right click --> properties (or press ALt + Enter ) --> Config properties --> Input -->
    In the right sheet , the first line : Additional Dependencies --> you click this line and choose <edit> then add the name of your library (.lib)
    Certainly, this means your .lib must be registered with your VS2010 else , you must register by right click --> properties --> Config Properties --> VC++ Directories -->
    in the right sheet , the 4th line , see and click "Library Directories " --> then add your link to folder that contains your .lib files .
    Cheer ,
     
  3. Hwciua4i

    Hwciua4i New Member

    Joined:
    Sep 29, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Thanks for the reply.

    Yes I had already tried going there and making sure it was all there.

    The thing is, the instructor gave the framework which had all of the stuff already included.
    It compiles initially but suddenly if I close and open the solution file or something - it suddenly gives the link error.

    After which I check the solution explorer and make sure everything's added and still no luck. I try reloading the library project, cleaning, building, etc. with no luck. Then I try getting a fresh copy and just copying my code into it - and still I get the link error.

    But suddenly if I get lucky it, I get the fresh copy and it compiles fine. So I managed to finish it and submit, but still would like to know what caused the issue if anyone knows.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice