Skip to content

Commit 39a5ca2

Browse files
author
mikeblome
committed
fixed merge conflicts with topic consolidation with new project from existing code node
2 parents f91f197 + 6c0a77f commit 39a5ca2

File tree

204 files changed

+1994
-1622
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

204 files changed

+1994
-1622
lines changed

.openpublishing.redirection.json

+661-5
Large diffs are not rendered by default.

docs/build/TOC.md

-4
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
### [Troubleshoot Build Customizations](troubleshooting-build-customizations.md)
1313
### [Format the Output of a Custom Build Step or Build Event](formatting-the-output-of-a-custom-build-step-or-build-event.md)
1414
## [Create a project from existing code](how-to-create-a-cpp-project-from-existing-code.md)
15-
### [Specify Project Location and Source Files, Create New Project From Existing Code Files Wizard](specify-project-location-and-source-files.md)
16-
### [Specify Project Settings, Create New Project From Existing Code Files Wizard](specify-project-settings-create-new-project-from-existing-code-files-wizard.md)
17-
### [Specify Debug Configuration Settings, Create New Project From Existing Code Files Wizard](specify-debug-configuration-settings.md)
18-
### [Specify Release Configuration Settings, Create New Project From Existing Code Files Wizard](specify-release-configuration.md)
1915
# [CMake projects](cmake-tools-for-visual-cpp.md)
2016
# [Open Folder projects](non-msbuild-projects.md)
2117
# [Precompiled header files](creating-precompiled-header-files.md)

docs/build/exporting-from-a-dll-using-def-files.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
---
22
title: "Exporting from a DLL Using DEF Files"
3-
ms.date: "11/04/2016"
3+
ms.date: "01/09/2018"
44
helpviewer_keywords: ["def files [C++], exporting from DLLs", ".def files [C++], exporting from DLLs", "exporting DLLs [C++], DEF files"]
55
ms.assetid: 9d31eda2-184e-47de-a2ee-a93ebd603f8e
66
---
77
# Exporting from a DLL Using DEF Files
88

9-
A module-definition (.def) file is a text file containing one or more module statements that describe various attributes of a DLL. If you are not using the **__declspec(dllexport)** keyword to export the DLL's functions, the DLL requires a .def file.
9+
A module-definition or DEF file (*.def) is a text file containing one or more module statements that describe various attributes of a DLL. If you are not using the **__declspec(dllexport)** keyword to export the DLL's functions, the DLL requires a DEF file.
1010

11-
A minimal .def file must contain the following module-definition statements:
11+
A minimal DEF file must contain the following module-definition statements:
1212

13-
- The first statement in the file must be the LIBRARY statement. This statement identifies the .def file as belonging to a DLL. The LIBRARY statement is followed by the name of the DLL. The linker places this name in the DLL's import library.
13+
- The first statement in the file must be the LIBRARY statement. This statement identifies the DEF file as belonging to a DLL. The LIBRARY statement is followed by the name of the DLL. The linker places this name in the DLL's import library.
1414

1515
- The EXPORTS statement lists the names and, optionally, the ordinal values of the functions exported by the DLL. You assign the function an ordinal value by following the function's name with an at sign (@) and a number. When you specify ordinal values, they must be in the range 1 through N, where N is the number of functions exported by the DLL. If you want to export functions by ordinal, see [Exporting Functions from a DLL by Ordinal Rather Than by Name](exporting-functions-from-a-dll-by-ordinal-rather-than-by-name.md) as well as this topic.
1616

@@ -25,11 +25,11 @@ EXPORTS
2525
Min @4
2626
```
2727

28-
If you use the [MFC DLL Wizard](../mfc/reference/mfc-dll-wizard.md) to create an MFC DLL, the wizard creates a skeleton .def file for you and automatically adds it to your project. Add the names of the functions to be exported to this file. For non-MFC DLLs, you must create the .def file yourself and add it to your project.
28+
If you use the [MFC DLL Wizard](../mfc/reference/mfc-dll-wizard.md) to create an MFC DLL, the wizard creates a skeleton DEF file for you and automatically adds it to your project. Add the names of the functions to be exported to this file. For non-MFC DLLs, create the DEF file yourself and add it to your project. Then go to **Project** > **Properties** > **Linker** > **Input** > **Module Definition File** and enter the name of the DEF file. Repeat this step for each configuration and platform, or do it all at once by selecting **Configuration = All Configurations**, and **Platform = All Platforms**.
2929

30-
If you are exporting functions in a C++ file, you have to either place the decorated names in the .def file or define your exported functions with standard C linkage by using extern "C". If you need to place the decorated names in the .def file, you can obtain them by using the [DUMPBIN](reference/dumpbin-reference.md) tool or by using the linker [/MAP](reference/map-generate-mapfile.md) option. Note that the decorated names produced by the compiler are compiler specific. If you place the decorated names produced by the MSVC compiler into a .def file, applications that link to your DLL must also be built using the same version of Visual C++ so that the decorated names in the calling application match the exported names in the DLL's .def file.
30+
If you are exporting functions in a C++ file, you have to either place the decorated names in the DEF file or define your exported functions with standard C linkage by using extern "C". If you need to place the decorated names in the DEF file, you can obtain them by using the [DUMPBIN](../build/reference/dumpbin-reference.md) tool or by using the linker [/MAP](../build/reference/map-generate-mapfile.md) option. Note that the decorated names produced by the compiler are compiler specific. If you place the decorated names produced by the Visual C++ compiler into a DEF file, applications that link to your DLL must also be built using the same version of Visual C++ so that the decorated names in the calling application match the exported names in the DLL's DEF file.
3131

32-
If you are building an [extension DLL](extension-dlls-overview.md), and exporting using a .def file, place the following code at the beginning and end of your header files that contain the exported classes:
32+
If you are building an [extension DLL](../build/extension-dlls-overview.md), and exporting using a DEF file, place the following code at the beginning and end of your header files that contain the exported classes:
3333

3434
```
3535
#undef AFX_DATA
@@ -41,9 +41,9 @@ If you are building an [extension DLL](extension-dlls-overview.md), and exportin
4141

4242
These lines ensure that MFC variables that are used internally or that are added to your classes are exported (or imported) from your MFC extension DLL. For example, when deriving a class using `DECLARE_DYNAMIC`, the macro expands to add a `CRuntimeClass` member variable to your class. Leaving out these four lines might cause your DLL to compile or link incorrectly or cause an error when the client application links to the DLL.
4343

44-
When building the DLL, the linker uses the .def file to create an export (.exp) file and an import library (.lib) file. The linker then uses the export file to build the DLL file. Executables that implicitly link to the DLL link to the import library when they are built.
44+
When building the DLL, the linker uses the DEF file to create an export (.exp) file and an import library (.lib) file. The linker then uses the export file to build the DLL file. Executables that implicitly link to the DLL link to the import library when they are built.
4545

46-
Note that MFC itself uses .def files to export functions and classes from the MFCx0.dll.
46+
Note that MFC itself uses DEF files to export functions and classes from the MFCx0.dll.
4747

4848
## What do you want to do?
4949

Original file line numberDiff line numberDiff line change
@@ -1,32 +1,65 @@
11
---
22
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"]
56
ms.assetid: e328a938-395c-48ea-9e35-dd433de12b31
67
---
78
# How to: Create a C++ Project from Existing Code
89

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.
1011

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).
1213

1314
### To create a C++ project from existing code
1415

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**.
1617

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.
1819

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.
2021

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. |
2228

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+
![Project location](media/location.png)
2430

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.
2632

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. |
2837

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+
![Project settings](media/settings.png)
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+
![Project configuration](media/config.png)
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.

docs/build/reference/fp-specify-floating-point-behavior.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ The [/Za](za-ze-disable-language-extensions.md) (ANSI compatibility) option is n
5858

5959
### Using Pragmas to Control Floating-Point Behavior
6060

61-
The compiler provides three pragma directivess to override the floating-point behavior specified on the command-line: [float_control](../../preprocessor/float-control.md), [fenv_access](../../preprocessor/fenv-access.md), and [fp_contract](../../preprocessor/fp-contract.md). You can use these pragmas to control floating-point behavior at function-level, not within a function. Note that these pragmas do not correspond directly to the **/fp** options. This table shows how the **/fp** options and pragmas map to each other. For more information, see the documentation for the individual options and pragmas.
61+
The compiler provides three pragma directives to override the floating-point behavior specified on the command-line: [float_control](../../preprocessor/float-control.md), [fenv_access](../../preprocessor/fenv-access.md), and [fp_contract](../../preprocessor/fp-contract.md). You can use these pragmas to control floating-point behavior at function-level, not within a function. Note that these pragmas do not correspond directly to the **/fp** options. This table shows how the **/fp** options and pragmas map to each other. For more information, see the documentation for the individual options and pragmas.
6262

6363
||float_control(precise)|float_control(except)|fenv_access|fp_contract|
6464
|-|-|-|-|-|

0 commit comments

Comments
 (0)