Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configure VS2010 to build a C++ project to a reasonably clean output directory?

In VS2010 a one line hello world C++ console program using the default project configuration outputs over 30 files of intermediate build files to its output directory. Obj files, pch files, ilk, log, buildstate, idb, embedded manifest and rc files and no less than 18 tlog files.

None of this is actually output, for an exe console app the only files which are genuine output are the exe itself and the pdb file.

So my question is this: Is there any way to configure VS2010 to build all this garbage into an intermediate directory and output just the useful stuff to the output directory?

like image 385
Neutrino Avatar asked Jun 07 '12 21:06

Neutrino


People also ask

How do I change the build directory output?

Right-click on the project node in Solution Explorer and select Properties. Expand the Build section, and select the Output subsection. Find the Base output path for C#, and type in the path to generate output to (absolute or relative to the root project directory), or choose Browse to browse to that folder instead.

What is output directory?

The Output Directory—Applies to both synthesis and simulation generation. By default, the path of the generation output directory is fixed relative to the . qsys file. You can change the default directory in the Generation dialog box for legacy devices.


1 Answers

In Visual Studio, open the Solution Explorer, right-click the project and select Properties... In the Property Pages dialog, navigate to Configuration Properties -> General. The first two properties control where the build output goes:

  • Output Directory: This is the directory into which the final build output (.exe, .pdb, .ilk) is placed

  • Intermediate Directory: This is the directory into which (most) everything else is placed.

If you use the typical project layout, where the project is in a folder under the solution folder, these properties will be configured so that the two directories are different. You can, of course, configure them to place the output wherever you'd like.

like image 67
James McNellis Avatar answered Oct 18 '22 17:10

James McNellis