Visual Studio 9: Display Linker Search Paths
c++, linker, visual-studio, visual-studio-2008
Solution
I figured out one way to do this after posting my question above. I don't know if this is an advisable method, but it worked for me and I was able to solve the problem.
I created a custom pre-link step which simply issued a `cd` command with no arguments, to display the current working directory.
Under Configuration Properties > Build Events > Pre-Link Event, I set the Command Line property to:
cd
On building again, the output was:
1>------ Build started: Project: MyThingy, Configuration: Release x64 ------
1>Performing Pre-Link Event...
1>c:\build\VS2008\SuperWare\Some\Library\
1>Linking...
The library I'm looking for is located under:
c:\build\vs2008\SuperWare\Tools\Gizmo\x64\Release
From this I was able to deduce the relative path I need is:
..\..\Tools\Gizmo\x64\Release
I changed the Additional Library Directories property accordingly, and the build succeeded.
Problem
How do I convince the MSVC9 linker to show me which paths it is searching for include libraries (`lib`s) in? I am trying to solve a problem where I am getting the following linker error: ``` LINK : fatal error LNK1104: cannot open file 'MyGizmo.lib' ``` Under Linker > General, I have Additional Library Directories set as: ``` ..\..\..\x64\Release ``` Which is, I thought, where the lib file I'm looking for resides. When I change this path to the fully-qualified directory where the lib file is, the linker passes and finds the lib file. Therefore, I conclude that the way I have entered my relative path above is incorrect. If the path is relative to where the source code lives, this relative path should be correct. So how do I tell the MSVC9 linker to tell me what it thinks `..\..\..\x64\Release` resolves to?