Discussion:
VS 2008 linker: how to see the paths that the linker is following to libc*.lib?
(too old to reply)
lcplben
2009-10-22 11:19:04 UTC
Permalink
Hi folks --

Trying to track down the cause of a sudden failure in _read( ): the
build worked great and then, five mins later, it croaked and now /
nothing/ will build correctly. The exact problem is that _read( )
returns fewer than "count" bytes. To start off with, I'm guessing
that _read( ) is somewhere in libc*.lib, so:

I'd like to see the actual paths that the linker followed to satisfy a
requirement for libc*.lib. Is there some config switch in the DE that
will show those paths?

Or is it perhaps that the paths are explicit in the LIB and LIBPATH
environment variables? Are there other paths implicit in the linker?
Here are the environment variables for LIB and LIBPATH:

LIB=
C:\Program Files\Microsoft Visual Studio 8\VC\lib;
C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\lib;
C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\lib\i386;
C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\lib;
C:\Program Files\Microsoft Visual Studio 8\;
C:\Program Files\Microsoft Visual Studio 8\lib;
C:\Program Files\Microsoft SDKs\Windows\v6.1\lib

LIBPATH=
C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0;
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;
C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\lib;
C:\Program Files\Reference Assemblies\Microsoft\Framework;
C:\Program Files\Reference Assemblies\Microsoft\mmc;
C:\Program Files\Reference Assemblies\Microsoft\Tablet PC;
C:\Program Files\Reference Assemblies\Microsoft\UDDI;
C:\Program Files\Reference Assemblies\Microsoft\WindowsPowerShell


Thanks!

-- ben
Carl Daniel [VC++ MVP]
2009-10-22 14:01:58 UTC
Permalink
Post by lcplben
Hi folks --
Trying to track down the cause of a sudden failure in _read( ): the
build worked great and then, five mins later, it croaked and now /
nothing/ will build correctly. The exact problem is that _read( )
returns fewer than "count" bytes. To start off with, I'm guessing
I'd like to see the actual paths that the linker followed to satisfy a
requirement for libc*.lib. Is there some config switch in the DE that
will show those paths?
Use the /VERBOSE linker option to see exactly what was linked from where.
Beware - the output is quite large, so you'll definitely want to redirect
the linker output to a file (if you're doing command-line builds).

One possiblity for the variation you're seeing: When you build from inside
Visual Studio, the environment variables (LIB, etc) are ignored and the
directories configured in VS are used. When you build from the command
line, the environment variables are used. If you're always building in the
IDE or always from the command line, then this is not the problem..

-cd
Ben Voigt [C++ MVP]
2009-10-26 22:17:46 UTC
Permalink
Post by lcplben
Hi folks --
Trying to track down the cause of a sudden failure in _read( ): the
build worked great and then, five mins later, it croaked and now /
nothing/ will build correctly. The exact problem is that _read( )
returns fewer than "count" bytes. To start off with, I'm guessing
That's not a "problem", that's expected and documented behavior.

http://msdn.microsoft.com/en-us/library/wyssk1bs.aspx

"The _read function reads a maximum of count bytes into buffer from the file
associated with fd."
"_read returns the number of bytes read, which might be less than count"
Post by lcplben
I'd like to see the actual paths that the linker followed to satisfy a
requirement for libc*.lib. Is there some config switch in the DE that
will show those paths?
Or is it perhaps that the paths are explicit in the LIB and LIBPATH
environment variables? Are there other paths implicit in the linker?
LIB=
C:\Program Files\Microsoft Visual Studio 8\VC\lib;
C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\lib;
C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\lib\i386;
C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\lib;
C:\Program Files\Microsoft Visual Studio 8\;
C:\Program Files\Microsoft Visual Studio 8\lib;
C:\Program Files\Microsoft SDKs\Windows\v6.1\lib
LIBPATH=
C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0;
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;
C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\lib;
C:\Program Files\Reference Assemblies\Microsoft\Framework;
C:\Program Files\Reference Assemblies\Microsoft\mmc;
C:\Program Files\Reference Assemblies\Microsoft\Tablet PC;
C:\Program Files\Reference Assemblies\Microsoft\UDDI;
C:\Program Files\Reference Assemblies\Microsoft\WindowsPowerShell
Thanks!
-- ben
Continue reading on narkive:
Search results for 'VS 2008 linker: how to see the paths that the linker is following to libc*.lib?' (Questions and Answers)
10
replies
What is AIX Box?
started 2006-05-08 15:58:44 UTC
hardware
Loading...