title: How do I compile a .cpp file just to object file without calling linker
body: <p>I am trying to compile a single .cpp file separately from the build process.</p>
  
  <p>If I do a full build then the compile step outputs to the directory configured when creating the project.</p>
  
  <p>However if I just ask for a compile I end up with the object file going to the same directory as the source, and even worse it goes on and links the object file to the executable when it is supposedly doing a compile.</p>
  
  <p>Note I am compiling with clang++ for C++11, but I don't think that has any barring on why it is calling Clang++.exe a second time for linking which has not been requested.</p>
  
  <p><strong>Edit1</strong></p>
  
  <p>When building it does this</p>
  
  <pre><code>-------------- Build: Debug in GOTW (compiler: GNU GCC Compiler)---------------
  
  clang++.exe -Wall -fexceptions  -g  -std=c++11 -stdlib=libstdc++    -c                
  C:\Work\test\2010\C++11\CLang\GOTW\gotw.cpp -o obj\Debug\GOTW.o
  clang++.exe  -o bin\Debug\GOTW.exe obj\Debug\GOTW.o    
  Output size is 203.50 KB
  Process terminated with status 0 (0 minutes, 11 seconds)
  0 errors, 6 warnings (0 minutes, 11 seconds)
  </code></pre>
  
  <p>Yet when <code>Compile Current File</code> is performed it does this:</p>
  
  <pre><code>clang++.exe -std=c++11 -stdlib=libstdc++    -c GOTW.cpp -o GOTW.o
  1 warning generated.
  clang++.exe  -o GOTW.exe GOTW.o   
  </code></pre>
  
  <p>I don't understand why it is outputting the second step, and also how to get it to use the obj and bin directories like the build does</p>