Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   Help with a link error (http://www.go4expert.com/forums/help-link-error-t23445/)

Hwciua4i 29Sep2010 17:40

Help with a link error

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:

cutithongtin 29Sep2010 22:51

Re: Help with a link error
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 ,

Hwciua4i 30Sep2010 19:09

Re: Help with a link error
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.

All times are GMT +5.5. The time now is 05:20.