Building C++ Projects in Visual Studio

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Building C++ Projects in Visual Studio.

In the Visual Studio integrated development environment (IDE), there are several ways to build an entire solution or just one project in it. You can also modify build settings and specify custom build steps to make your development process more efficient.

To build a solution that's open in Visual Studio and selected in Solution Explorer, you can:

  • On the menu bar, choose Build, Build Solution.

  • Or, in Solution Explorer, open the shortcut menu for the solution and then choose Build Solution.

  • Or, press F7. (This is the default keyboard shortcut for the C/C++ development settings.)

  • Or, in the Command Window (on the menu bar, choose View, Other Windows, Command Window), enter Build.BuildSolution.

  • Or, in the Quick Launch box, enter build build solution.

To build a project that's selected in Solution Explorer, you can:

  • On the menu bar, choose Build, Build <Project Name>.

  • Or, in Solution Explorer, open the shortcut menu for the project and then choose Build.

  • Or, in the Command Window (on the menu bar, choose View, Other Windows, Command Window), enter Build.BuildOnlyProject.

  • Or, in the Quick Launch box, enter build project only build only <project name>.

When you build a Visual C++ application in Visual Studio, you can modify many of the build's settings in the project's Property Pages dialog box. For information about how to set project properties, see Working with Project Properties.

For an example about how to use the IDE to create, build, and debug a C++ project, see Walkthrough: Explore the Visual Studio IDE with C++. For an example about how to use the IDE to build a C++/CLR project, see Walkthrough: Compiling a C++ Program that Targets the CLR in Visual Studio. For an example about how to use the IDE to create a Windows Runtime app, see Create your first Windows Runtime app using C++.

To read more about how to build, modify build settings, and specify custom build steps, see the following articles.

Understanding Custom Build Steps and Build Events
Describes how to customize the build process in the integrated development environment.

Common Macros for Build Commands and Properties
Lists macros that you can use where strings are accepted.

Building External Projects
Discusses building projects that use facilities outside the integrated development environment.

Project Files
Presents the XML structure of a .vcxproj file.

VC++ Directories, Projects, Options Dialog Box
Discusses how to modify the search path for executable files, include files, library files, and source code files during a build

Compiling and Building
Provides information on building within Visual Studio.

Building C/C++ Programs
Provides links to topics describing building your program from the command line or from the integrated development environment of Visual Studio.

C/C++ Building Reference
Provides links to an overview of building programs in C++, compiler and linker options, and additional build tools.

Upgrading Projects from Earlier Versions of Visual C++
Provides links to topics covering issues on upgrading Visual C++ 6.0 and later projects to Visual C++ .NET.

Porting and Upgrading Programs
Provides details about porting applications and discusses makefiles.

Roadmap for Windows Store apps using C++

Show: