Re: Link warning and error, what do they mean?

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Victor Bazarov (v.Abazarov_at_comAcast.net)
Date: 12/01/04


Date: Wed, 01 Dec 2004 14:40:49 -0500

M K wrote:
> Thank you sooo much... I never heard of F1 before. It opens a whole world of
> possibilities...

Are you trying to show sarcasm or something?

> Let's take this error here, given to us by the linker:
> LINK : fatal error LNK1181: cannot open input file
> '.\debug\KPDCLoader_Win.obj'
>
> Now, I hit F1, and get this:
>
> cannot open input file 'filename'
>
> The linker could not find filename because it does not exist or the path was
> not found.
> <
>
> Hmmm... very informative. I do some digging on MSDN, and get this article:
> http://support.microsoft.com/default.aspx?scid=kb;en-us;815645
>
> The problem I have is, KPDCLoader_Win.obj doesn't ring any bells.

It doesn't with you? Doesn't with me either. But with me it shouldn't
since it's not my project.

> I have a
> KPDCLoader.h (header file) but I'm not sure where the linker getting the
> '_Win'.

The header has nothing to do with the 'obj' file. The 'obj' file is the
result of compiling a C or C++ _source_ file.

>
> This was a VS 6 project, that I converted to VS 2k3.
>
> The path this error gives, .\debug, in my project's folder I have a debug
> folder and it's not readonly.
>
> input file... Hmm... I'm just not sure what they mean by input file.

What would anybody mean by "input file"? It's a file that a program needs
to open to read something from it. It is a usual requirement for an input
file is to exist by the time the program needs it.

> Should
> the link/build process be creating this .obj (input) file.

If that's a question, put the question mark after it. And if it was,
the answer is "no". The compilation process creates it. The linking
process relies on the file to be there when linker begins working.

Now, it is possible that an obj file is not the result of compiling any
of the files in your project. It is possible that an obj file is simply
added to the link command line because it was given to you by a third
party. Nobody but you would know that.

> If so, is the
> linker not linking in the correct order?

The linker is linking what it knows to link. It knows what to link from
the command line issued to it. The command line consists of options,
input files and the output file. The options are either default or taken
from the project settings. The input files are either the results of the
compilation phase or taken from the project settings. The output file
name is taken from the project settings.

> Where do I change the order if
> that's the case... F1 got me part of the way, but where do I go from here?!?!

Start looking at _all_ the settings in your project and learning what they
mean. Buy a book on VC.NET, if the existing documentation is not enough.

V



Relevant Pages

  • RE: Problems piping input into program
    ... The reason is that my input file AJH0011.txt was in the debug subdirectory under the project. ... I suppose yet another way to fix it would be to change the Project Settings - Working Directory so that it can find ... Click OK to accept the redirection and close the Project Settings dialog box. ...
    (microsoft.public.vc.ide_general)
  • Re: Link warning and error, what do they mean?
    ... LINK: fatal error LNK1181: cannot open input file ... The linker could not find filename because it does not exist or the path was ... linker not linking in the correct order? ...
    (microsoft.public.vc.ide_general)
  • Problem with 64 bit gnu ld on sparc (sol8)
    ... I'm using solaris 8 and have a problem with the installed gnu ld linker: ... ld: warning: sparc:v9 architecture of input file ...
    (comp.unix.solaris)