title: How to read verbose VC++ linker output
body: <p>Trying to debug some linker errors, I turned on /VERBOSE and I'm trying to make sense of the output. It occurs to me that I really don't know how to read it.</p>
  
  <p>For example:</p>
  
  <pre><code>1&gt;Compiling version info
  1&gt;Linking...
  1&gt;Starting pass 1
  1&gt;Processed /DEFAULTLIB:mfc80.lib
  1&gt;Processed /DEFAULTLIB:mfcs80.lib
  1&gt;Processed /DEFAULTLIB:msvcrt.lib
  1&gt;Processed /DEFAULTLIB:kernel32.lib
  1&gt;Processed /DEFAULTLIB:user32.lib
  ....
  1&gt;Processed /DEFAULTLIB:libgslcblasMD.lib
  1&gt;Searching libraries
  1&gt;    Searching V:\Src\Solutions\\..\..\\Common\Win32\Lib\PlxApi.lib:
  1&gt;    Searching ..\..\..\..\out\win32\release\lib\camerageometry.lib:
  1&gt;    Searching ..\..\..\..\out\win32\release\lib\geometry.lib:
  1&gt;      Found "public: __thiscall VisionMap::Geometry::Box2d::operator class VisionMap::Geometry::Box2DInt(void)const " (??BBox2d@Geometry@VisionMap@@QBE?AVBox2DInt@12@XZ)
  1&gt;        Referenced in FocusDlg.obj
  1&gt;        Loaded geometry.lib(Box2d.obj)
  1&gt;Processed /DEFAULTLIB:CGAL-vc80-mt.lib
  1&gt;Processed /DEFAULTLIB:boost_thread-vc80-mt-1_33_1.lib
  </code></pre>
  
  <p>What's going on here?</p>
  
  <p>I think I understand this bit:</p>
  
  <pre><code>1&gt;Processed /DEFAULTLIB:libgslcblasMD.lib
  1&gt;Searching libraries
  1&gt;    Searching V:\Src\Solutions\\..\..\\Common\Win32\Lib\PlxApi.lib:
  1&gt;    Searching ..\..\..\..\out\win32\release\lib\camerageometry.lib:
  1&gt;    Searching ..\..\..\..\out\win32\release\lib\geometry.lib:
  1&gt;      Found "public: __thiscall VisionMap::Geometry::Box2d::operator class VisionMap::Geometry::Box2DInt(void)const " (??BBox2d@Geometry@VisionMap@@QBE?AVBox2DInt@12@XZ)
  1&gt;        Referenced in FocusDlg.obj
  1&gt;        Loaded geometry.lib(Box2d.obj)
  </code></pre>
  
  <p>It's trying to find the implementation of the above operator, which is used somewhere in FocusDlg.cpp, and it finds it in geometry.lib.</p>
  
  <p>But what does <code>1&gt;Processed /DEFAULTLIB:libgslcblasMD.lib</code> mean? What determines the order of symbol resolution? Why is it loading this particular symbol while processing <code>libgslcblasMD.lib</code> which is a 3rd party library? Or am I reading it wrong?</p>
  
  <p>It seems that the linker is going through the symbols referenced in the project's various object files, but I have no idea in what order. It then searches the static libraries the project uses - by project reference, explicit import and automatic default library imports; but it does so in an order that, again, seems arbitrary to me. </p>
  
  <p>When it finds a symbol, for example in geometry.lib, it then continues to find a bunch of other symbols from the same lib:</p>
  
  <pre><code>1&gt;    Searching V:\Src\Solutions\\..\..\\Common\Win32\Lib\PlxApi.lib:
  1&gt;    Searching ..\..\..\..\out\win32\release\lib\camerageometry.lib:
  1&gt;    Searching ..\..\..\..\out\win32\release\lib\geometry.lib:
  1&gt;      Found "public: __thiscall VisionMap::Geometry::Box2d::operator class VisionMap::Geometry::Box2DInt(void)const " (??BBox2d@Geometry@VisionMap@@QBE?AVBox2DInt@12@XZ)
  1&gt;        Referenced in FocusDlg.obj
  1&gt;        Loaded geometry.lib(Box2d.obj)
  1&gt;Processed /DEFAULTLIB:CGAL-vc80-mt.lib
  1&gt;Processed /DEFAULTLIB:boost_thread-vc80-mt-1_33_1.lib
  1&gt;      Found "public: __thiscall VisionMap::Geometry::Box2DInt::Box2DInt(int,int,int,int)" (??0Box2DInt@Geometry@VisionMap@@QAE@HHHH@Z)
  1&gt;        Referenced in FocusDlg.obj
  1&gt;        Referenced in ImageView.obj
  1&gt;        Referenced in geometry.lib(Box2d.obj)
  1&gt;        Loaded geometry.lib(Box2DInt.obj)
  1&gt;      Found "public: virtual __thiscall VisionMap::Geometry::Point3d::~Point3d(void)" (??1Point3d@Geometry@VisionMap@@UAE@XZ)
  1&gt;        Referenced in GPSFrm.obj
  1&gt;        Referenced in MainFrm.obj
  1&gt;        Loaded geometry.lib(Point3d.obj)
  1&gt;      Found "void __cdecl VisionMap::Geometry::serialize&lt;class boost::archive::binary_oarchive&gt;(class boost::archive::binary_oarchive &amp;,class VisionMap::Geometry::Point3d &amp;,unsigned int)" (??$serialize@Vbinary_oarchive@archive@boost@@@Geometry@VisionMap@@YAXAAVbinary_oarchive@archive@boost@@AAVPoint3d@01@I@Z)
  1&gt;        Referenced in GPSFrm.obj
  1&gt;        Referenced in MainFrm.obj
  1&gt;        Loaded geometry.lib(GeometrySerializationImpl.obj)
  </code></pre>
  
  <p>But then, for some reason, it goes on to find symbols that are defined in other libs, and returns to geometry later on (a bunch of times). </p>
  
  <p>So clearly it's not doing "look in geometry and load every symbol that's references in the project, and then continue to other libraries". But it's not clear to me what <em>is</em> the order of symbol lookup. </p>
  
  <p>And what's the deal with all those libraries being processed at the beginning of the linker's work, but not finding any symbols to load from them? Does this project really not use anything from <code>msvcrt.lib</code>, <code>kernel32.lib</code>? Seems unlikely.</p>
  
  <p>So basically I'm looking to decipher the underlying order in the linker's operation.</p>