|
1 | 1 | ---
|
2 | 2 | title: "How to: Create a C++ Project from Existing Code"
|
3 |
| -ms.date: "12/10/2018" |
4 |
| -helpviewer_keywords: ["C++, creating projects from existing code"] |
| 3 | +ms.date: "01/15/2019" |
| 4 | +helpviewer_keywords: ["C++, creating projects from existing code", "Create New Project From Existing Code Files Wizard, project settings"] |
| 5 | +f1_keywords: ["vc.appwiz.importwiz.location", "vc.appwiz.importwiz.appsettings", "vc.appwiz.importwiz.debugsettings", "vc.appwiz.importwiz.releasesettings"] |
5 | 6 | ms.assetid: e328a938-395c-48ea-9e35-dd433de12b31
|
6 | 7 | ---
|
7 | 8 | # How to: Create a C++ Project from Existing Code
|
8 | 9 |
|
9 |
| -In Visual Studio, you can port your existing code files into a Visual C++ project by using the **Create New Project From Existing Code Files** wizard. This wizard is not available in older Express editions of Visual Studio. This wizard creates a new solution and project that uses the MSBuild system to manage your source files and build configuration. |
| 10 | +In Visual Studio, you can port existing code files into a C++ project using the **Create New Project From Existing Code Files** wizard. This wizard creates a project solution that uses the MSBuild system to manage source files and build configuration. It works best with relatively simple projects that do not have complex folder hierarchies. The wizard isn't available in older Express editions of Visual Studio. |
10 | 11 |
|
11 |
| -Porting your existing code files into a Visual C++ project enables you to use all of the native MSBuild project management features built into the IDE. If you prefer to use your existing build system, such as nmake makefiles, CMake, or alternatives, you can use the Open Folder option instead. For more information, see [Open Folder projects in Visual C++](non-msbuild-projects.md). Both options let you use IDE features such as [IntelliSense](/visualstudio/ide/using-intellisense) and [Project Properties](working-with-project-properties.md). |
| 12 | +Porting existing code files into a C++ project enables the use of native MSBuild project management features built into the IDE. If you prefer to use your existing build system, such as nmake makefiles, CMake, or alternatives, you can use the Open Folder or CMake options instead. For more information, see [Open Folder projects in Visual C++](non-msbuild-projects.md) or [CMake projects in Visual Studio](cmake-tools-for-visual-cpp.md). Both options let you use IDE features such as [IntelliSense](/visualstudio/ide/using-intellisense) and [Project Properties](working-with-project-properties.md). |
12 | 13 |
|
13 | 14 | ### To create a C++ project from existing code
|
14 | 15 |
|
15 |
| -1. On the **File** menu, point to **New**, and then click **Project From Existing Code**. |
| 16 | +1. On the **File** menu, select **New** > **Project From Existing Code**. |
16 | 17 |
|
17 |
| -1. On the first page of the **Create New Project from Existing Code Files** wizard, select **Visual C++** in the **What type of project would you like to create** list. Choose **Next** to continue. |
| 18 | +1. On the first page of the **Create New Project from Existing Code Files** wizard, select **Visual C++** in the **What type of project would you like to create?** list. Choose **Next** to continue. |
18 | 19 |
|
19 |
| -1. Specify your project location and the directory for your source files. For details on this page, see [Specify Project Location and Source Files, Create New Project From Existing Code Files Wizard](specify-project-location-and-source-files.md). Choose **Next** to continue. |
| 20 | +1. Specify your project location, the directory for your source files, and the kinds of files the wizard imports into the new project. Choose **Next** to continue. |
20 | 21 |
|
21 |
| -1. Specify the project settings to use. For details on this page, see [Specify Project Settings, Create New Project From Existing Code Files Wizard](specify-project-settings-create-new-project-from-existing-code-files-wizard.md). Choose **Next** to continue. |
| 22 | + | Setting | Description | |
| 23 | + | --- | --- | |
| 24 | + | **Project file location** | Specifies the directory path of the new project. This location is where the wizard deposits all the files (and subdirectories) of the new project.<br/><br/>Select **Browse** to display the **Project file location** dialog. Navigate to the right folder and specify the directory that contains the new project. | |
| 25 | + | **Project name** | Specifies the name of the new project. Project files, which have file extensions such as .vcxproj adopts this name and existing code files keep their original name. | |
| 26 | + | **Add files to the project from these folders** | Check to set the wizard to copy existing code files from their original directories (that are specified in the list box below this control) into the new project.<br/><br/>Check **Add Subfolders** to specify copying code files from all subdirectories into the project. The directories are listed in the **Folder** column.<br/>- Select **Add** to display the **Add files to the project from this folder** dialog box, to specify directories the wizard searches for existing code files.<br/>- Select **Remove** to delete the directory path selected in the list box.<br/><br/>In the **File types to add to the project** box, specify the kinds of files that the wizard adds to the new project based on the given file extensions. File extensions are preceded with the asterisk wildcard character and are delimited in the list of file extensions by a semicolon. | |
| 27 | + | **Show all files in Solution Explorer** | Specifies that all files in the new project to be visible and displayed in the **Solution Explorer** window. This option is enabled by default. | |
22 | 28 |
|
23 |
| -1. Specify the Debug configuration settings to use. For details on this page, see [Specify Debug Configuration Settings, Create New Project From Existing Code Files Wizard](specify-debug-configuration-settings.md). Choose **Next** to continue. |
| 29 | +  |
24 | 30 |
|
25 |
| -1. Specify the Release configuration settings to use. For details on this page, see [Specify Release Configuration Settings, Create New Project From Existing Code Files Wizard](specify-release-configuration.md). Choose **Finish** to generate the new project. |
| 31 | +1. Specify the project settings to use such as the build environment for the new project and the build settings to match a specific type of new project to generate. Choose **Next** to continue. |
26 | 32 |
|
27 |
| -## In this section |
| 33 | + | Setting | Description | |
| 34 | + | --- | --- | |
| 35 | + | **Use Visual Studio** | Specifies to use build tools that are included in Visual Studio for building the new project. This option is selected by default.<br/><br/>Select **Project Type** to specify the type of project the wizard generates. Choose **Windows application project**, **Console application project**, **Dynamically linked library (DLL) project**, or **Static library (LIB) project**.<br/><br/>Check **Add support for ATL** to add ATL support to the new project.<br/><br/>Check **Add support for MFC** to add MFC support to the new project.<br/><br/>Check **Add support for the Common Language Runtime** to add CLR programming support to the project. Choose the **Common Language Runtime Support** for compliance type, such as **Common Language Runtime (old syntax)** for compliance with Managed Extensions for C++ syntax, the CLR programming syntax before Visual C++ 2005. | |
| 36 | + | **Use external build system** | Specifies to use build tools that aren't included in Visual Studio for building the new project. When this option is selected, you can specify build command lines on the **Specify Debug Configuration Settings** and **Specify Release Configuration Settings** pages. | |
28 | 37 |
|
29 |
| -[Specify Project Location and Source Files, Create New Project From Existing Code Files Wizard](specify-project-location-and-source-files.md)<br/> |
30 |
| -[Specify Project Settings, Create New Project From Existing Code Files Wizard](specify-project-settings-create-new-project-from-existing-code-files-wizard.md)<br/> |
31 |
| -[Specify Debug Configuration Settings, Create New Project From Existing Code Files Wizard](specify-debug-configuration-settings.md)<br/> |
32 |
| -[Specify Release Configuration Settings, Create New Project From Existing Code Files Wizard](specify-release-configuration.md)<br/> |
| 38 | +  |
| 39 | + |
| 40 | + > [!NOTE] |
| 41 | + > When the **Use External Build System** option is checked, the IDE doesn't build the project, so the /D, /I, /FI, /AI, or /FU options aren't required for compilation. However, these options must be set correctly in order for IntelliSense to function properly. |
| 42 | +
|
| 43 | +1. Specify the Debug configuration settings to use. Choose **Next** to continue. |
| 44 | + |
| 45 | + | Setting | Description | |
| 46 | + | --- | --- | |
| 47 | + | **Build command line** | Specifies the command line that builds the project. Enter the name of the compiler (plus any switches or arguments) or the build scripts that you want to use to build the project. | |
| 48 | + | **Rebuild command line** | Specifies the command line that rebuilds the new project. | |
| 49 | + | **Clean command line** | Specifies the command line to delete support files generated by the build tools for the project. | |
| 50 | + | **Output (for debugging)** | Specifies the directory path of the output files for the Debug configuration of the project. | |
| 51 | + | **Preprocessor definitions (/D)** | Defines preprocessor symbols for the project, see [/D (Preprocessor Definitions)](../build/reference/d-preprocessor-definitions.md). | |
| 52 | + | **Include search path (/I)** | Specifies directory paths the compiler searches to resolve file references passed to preprocessor directives in the project, see [/I (Additional Include Directories)](../build/reference/i-additional-include-directories.md). | |
| 53 | + | **Forced included files (/FI)** | Specifies header files to process when building the project, see [/FI (Name Forced Include File)](../build/reference/fi-name-forced-include-file.md). | |
| 54 | + | **.NET assembly search path (/AI)** | Specifies the directory paths that the compiler searches to resolve .NET assembly references passed to preprocessor directives in the project, see [/AI (Specify Metadata Directories)](../build/reference/ai-specify-metadata-directories.md). | |
| 55 | + | **Forced using .NET assemblies (/FU)** | Specifies .NET assemblies to process when building the project, see [/FU (Name Forced #using File)](../build/reference/fu-name-forced-hash-using-file.md). | |
| 56 | + |
| 57 | +  |
| 58 | + |
| 59 | + > [!NOTE] |
| 60 | + > The **Build**, **Rebuild**, **Clean** command line, and **Output (for debugging)** settings are only enabled if the **Use external build system** option is selected on the **Specify Project Settings** page. |
| 61 | +
|
| 62 | +1. Specify the Release configuration settings to use, these settings are the same as the Debug configuration settings. Choose **Finish** to generate the new project. |
| 63 | + |
| 64 | + > [!NOTE] |
| 65 | + > Here you can check **Same as Debug configuration** to specify that the wizard will generate Release configuration project settings identical to Debug configuration project settings. This option is checked by default. All other options on this page are inactive unless you uncheck this box. |
0 commit comments