title: Partial linking of object files with Visual Studio
body: <p>We have a project which has a multistage build system: it's split into modules consisting of multiple source files, and each module is compiled and partially linked into a single object file. Then these object files are linked together into the final program. (This approach is required for non-technical reasons.)</p>
  
  <p>Currently we use gcc and binutils for this, and it's very easy there: <code>ld -r</code> will partially  link multiple object files into one.</p>
  
  <p>Unfortunately, we've now been faced with a platform for which there is no gcc/binutils support, only Visual C support. So I've been reworking the build system to use the native Microsoft tools. Unfortunately I have not yet found a way to do a partial link --- link.exe seems to only support outputting EXE or DLL files.</p>
  
  <p>Does anyone know of a way to do a partial link in Visual Studio?</p>
  
  <p>Note that .LIB libraries are <em>not</em> adequate. Neither is incremental linking. And this is all happening from the command line.</p>