Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,39 +1,38 @@
---
description: "Learn more about: How to: Modify the Target Framework and Platform Toolset"
title: "How to: Modify the Target Framework and Platform Toolset"
ms.custom: "conceptual"
ms.date: "07/24/2019"
ms.custom: "contperf-fy21q3"
ms.date: 03/31/2021
helpviewer_keywords: ["msbuild (c++), howto: modify target framework and platform toolset"]
ms.assetid: 031b1d54-e6e1-4da7-9868-3e75a87d9ffe
---
# How to: Modify the Target Framework and Platform Toolset

You can edit a Visual Studio C++ project file to target different versions of the C++ platform toolset, the Windows SDK and the .NET Framework (C++/CLI projects only). By default, the project system uses the .NET Framework version and the toolset version that correspond to the version of Visual Studio that you use to create the project. You can modify all these values in the .vcxproj file so that you can use the same code base for every compilation target.
You can edit a Visual Studio C++ project file to target different versions of the C++ platform toolset. The Windows SDK and the .NET Framework used are also editable. (The .NET Framework applies to C++/CLI projects only). A new project uses the default .NET Framework and toolset of the Visual Studio version that you use to create the project. If you modify these values in the .vcxproj file, you can use the same code base for every compilation target.

## Platform toolset

The platform toolset consists of the C++ compiler (cl.exe) and linker (link.exe), along with the C/C++ standard libraries. Since Visual Studio 2015, the major version of the toolset has remained at 14, which means that projects compiled with Visual Studio 2019 or Visual Studio 2017 are ABI-backwards-compatible with projects compiled with Visual Studio 2015. The minor version has updated by 1 for each version since Visual Studio 2015:
The platform toolset consists of the C++ compiler (cl.exe) and linker (link.exe), along with the C/C++ standard libraries. Visual Studio 2015, Visual Studio 2017, and Visual Studio 2019 are binary-compatible. It's shown by the major version of the toolset, which has remained at 14. Projects compiled in Visual Studio 2019 or Visual Studio 2017 are ABI-backwards-compatible with 2017 and 2015 projects. The minor version has updated by 1 for each version since Visual Studio 2015:

- Visual Studio 2015: v140
- Visual Studio 2017: v141
- Visual Studio 2019: v142

These toolsets support .NET Framework 4.5 and later.
These toolsets support the .NET Framework 4.5 and later.

Visual Studio also supports multitargeting for C++ projects. You can use the Visual Studio IDE to edit and build projects that were created with older versions of Visual Studio, without upgrading them to use a new version of the toolset. You do need to have the older toolsets installed on your computer. For more information, see [How to use native multi-targeting in Visual Studio](../porting/use-native-multi-targeting.md). For example, in Visual Studio 2015, you can *target* .NET Framework 2.0 but you must use an earlier toolset that supports it.
Visual Studio also supports multitargeting for C++ projects. You can use the latest Visual Studio IDE to edit and build projects created by older versions of Visual Studio. It doesn't require a project upgrade the projects to use a new version of the toolset. It does require the older toolset is installed on your computer. For more information, see [How to use native multi-targeting in Visual Studio](../porting/use-native-multi-targeting.md). For example, in Visual Studio 2015, you can *target* .NET Framework 2.0, but you must use an earlier toolset that supports it.

## Target framework (C++/CLI project only)

When you change the target Framework, also change the platform toolset to a version that supports that Framework. For example, to target the .NET Framework 4.5, you must use a compatible platform toolset such as Visual Studio 2015 (v140), Visual Studio 2013 (v120) or Visual Studio 2012 (v110). You can use the [Windows 7.1 SDK](https://www.microsoft.com/download/details.aspx?id=8279) platform toolset to target the .NET Framework 2.0, 3.0, 3.5, and 4, and the x86/x64 platforms.
When you change the target Framework, also change the platform toolset to a version that supports that Framework. For example, to target the .NET Framework 4.5, you must use a compatible platform toolset. These toolsets include Visual Studio 2015 (v140), Visual Studio 2013 (v120), or Visual Studio 2012 (v110). You can use the [Windows 7.1 SDK](https://www.microsoft.com/download/details.aspx?id=8279) to target .NET Framework 2.0, 3.0, 3.5, and 4.

You can extend the target platform further by creating a custom platform toolset. For more information, see [C++ Native Multi-Targeting](https://devblogs.microsoft.com/cppblog/c-native-multi-targeting/) on the Visual C++ blog.

### To change the target Framework

1. In Visual Studio, in **Solution Explorer**, select your project. On the menu bar, open the **Project** menu and choose **Unload project**. This unloads the project (.vcxproj) file for your project.
1. In Visual Studio, in **Solution Explorer**, select your project. On the menu bar, open the **Project** menu and choose **Unload project**. This command unloads the project (.vcxproj) file for your project.

> [!NOTE]
> A C++ project cannot be loaded while the project file is being modified in Visual Studio. However, you can use another editor such as Notepad to modify the project file while the project is loaded in Visual Studio. Visual Studio will detect that the project file has changed and prompt you to reload the project.
> A C++ project can't be loaded while you edit the project file in Visual Studio. However, you can use another editor such as Notepad to modify the project file while the project is loaded in Visual Studio. Visual Studio will detect that the project file has changed and prompt you to reload the project.

1. On the menu bar, select **File**, **Open**, **File**. In the **Open File** dialog box, navigate to your project folder, and then open the project (.vcxproj) file.

Expand All @@ -45,19 +44,23 @@ You can extend the target platform further by creating a custom platform toolset

1. In **Solution Explorer**, open the shortcut menu for your project and then choose **Reload Project**.

1. To verify the change, in **Solution Explorer**, right-click to open the shortcut menu for your project (not for your solution) and then choose **Properties** to open your project **Property Pages** dialog box. In the left pane of the dialog box, expand **Configuration Properties** and then select **General**. Verify that **.NET Target Framework Version** shows the new Framework version.
1. To verify the change, on the menu bar, select **Project** > **Properties** to open your project **Property Pages** dialog box. In the dialog box, select the **Configuration Properties** > **General** property page. Verify that **.NET Target Framework Version** shows the new Framework version.

### To change the platform toolset

1. In Visual Studio, in **Solution Explorer**, open the shortcut menu for your project (not for your solution) and then choose **Properties** to open your project **Property Pages** dialog box.
1. In Visual Studio, on the menu bar, select **Project** > **Properties** to open your project **Property Pages** dialog box.

1. In the **Property Pages** dialog box, open the **Configuration** drop-down list and then select **All Configurations**.
1. In the top of the **Property Pages** dialog box, open the **Configuration** drop-down list and then select **All Configurations**.

1. In the left pane of the dialog box, expand **Configuration Properties** and then select **General**.
1. In the dialog box, select the **Configuration Properties** > **General** property page.

1. In the right pane, select **Platform Toolset** and then select the toolset you want from the drop-down list. For example, if you have installed the Visual Studio 2010 toolset, select **Visual Studio 2010 (v100)** to use it for your project.
1. In the properties page, select **Platform Toolset** and then select the toolset you want from the drop-down list. For example, if you've installed the Visual Studio 2010 toolset, select **Visual Studio 2010 (v100)** to use it for your project.

1. Choose the **OK** button.
1. Choose the **OK** button to save your changes.

## Next Steps

[Walkthrough: Working with Projects and Solutions (C++)](../ide/walkthrough-working-with-projects-and-solutions-cpp.md)

## See also

Expand Down
2 changes: 1 addition & 1 deletion docs/build/integrate-vcpkg.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ If you've used the **`integrate`** option, you should remove the integration bef
[Install vcpkg](install-vcpkg.md)\
[Manage libraries with vcpkg](manage-libraries-with-vcpkg.md)\
[vcpkg command-line reference](vcpkg-command-line-reference.md)\
[Quick start](https://github.com/microsoft/vcpkg/blob/master/docs/index.md)\
[Quick start](https://github.com/microsoft/vcpkg/blob/master/docs/README.md)\
[Frequently asked questions](https://github.com/microsoft/vcpkg/blob/master/docs/about/faq.md)
2 changes: 1 addition & 1 deletion docs/build/manage-libraries-with-vcpkg.md
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,6 @@ Type **`vcpkg remove`** to remove an installed library. If any other libraries d
[Install vcpkg](install-vcpkg.md)\
[Integrate vcpkg](integrate-vcpkg.md)\
[vcpkg command-line reference](vcpkg-command-line-reference.md)\
[Quick start](https://github.com/microsoft/vcpkg/blob/master/docs/index.md)\
[Quick start](https://github.com/microsoft/vcpkg/blob/master/docs/README.md)\
[Frequently asked questions](https://github.com/microsoft/vcpkg/blob/master/docs/about/faq.md)\
[Installing and Using Packages Example: SQLite](https://github.com/microsoft/vcpkg/blob/master/docs/examples/installing-and-using-packages.md)
2 changes: 1 addition & 1 deletion docs/build/vcpkg-command-line-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ A quick reference to the commands available in vcpkg.
[Install vcpkg](install-vcpkg.md)\
[Integrate vcpkg](integrate-vcpkg.md)\
[Manage libraries with vcpkg](manage-libraries-with-vcpkg.md)\
[Quick start](https://github.com/microsoft/vcpkg/blob/master/docs/index.md)\
[Quick start](https://github.com/microsoft/vcpkg/blob/master/docs/README.md)\
[Frequently asked questions](https://github.com/microsoft/vcpkg/blob/master/docs/about/faq.md)
2 changes: 1 addition & 1 deletion docs/build/vcpkg.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,5 @@ Use the **`vcpkg contact --survey`** command to send feedback to Microsoft about
[Integrate vcpkg](integrate-vcpkg.md)\
[Manage libraries with vcpkg](manage-libraries-with-vcpkg.md)\
[vcpkg command-line reference](vcpkg-command-line-reference.md)\
[Quick start](https://github.com/microsoft/vcpkg/blob/master/docs/index.md)\
[Quick start](https://github.com/microsoft/vcpkg/blob/master/docs/README.md)\
[Frequently asked questions](https://github.com/microsoft/vcpkg/blob/master/docs/about/faq.md)
4 changes: 2 additions & 2 deletions docs/c-runtime-library/reference/ceil-ceilf-ceill.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ By default, this function's global state is scoped to the application. To change

|Routine|Required header|
|-------------|---------------------|
|**ceil**, **ceilf**, **ceill**|\<math.h>|
|**ceil** macro | \<tgmath.h> ||
| **ceil**, **ceilf**, **ceill**| \<math.h> |
| **ceil** macro | \<tgmath.h> |

For additional compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md).

Expand Down
2 changes: 1 addition & 1 deletion docs/c-runtime-library/reference/floor-floorf-floorl.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ By default, this function's global state is scoped to the application. To change
|Function|Required header|
|--------------|---------------------|
|**floor**, **floorf**, **floorl**|\<math.h>|
|**floor** macro | \<tgmath.h> ||
|**floor** macro | \<tgmath.h> |

For additional compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md).

Expand Down
2 changes: 1 addition & 1 deletion docs/c-runtime-library/reference/fmin-fminf-fminl.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ If you use the \<tgmath.h> `fmin()` macro, the type of the argument determines w
|Routine|Required header|
|-------------|---------------------|
|**fmin**, **fminf**, **fminl**|C: \<math.h><br />C++: \<math.h> or \<cmath>|
|**fmin** macro | \<tgmath.h> ||
|**fmin** macro | \<tgmath.h> |

For additional compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ By default, this function's global state is scoped to the application. To change
|Routine|Required header|
|-------------|---------------------|
|**lround**, **lroundf**, **lroundl**, **llround**, **llroundf**, **llroundl**|\<math.h>|
|**lround** macro | \<tgmath.h> ||
|**lround** macro | \<tgmath.h> |

For additional compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md).

Expand Down
2 changes: 1 addition & 1 deletion docs/c-runtime-library/reference/round-roundf-roundl.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ By default, this function's global state is scoped to the application. To change
|Routine|Required header|
|-------------|---------------------|
|**round**, **roundf**, **roundl**|\<math.h>|
|**round** macro | \<tgmath.h> ||
|**round** macro | \<tgmath.h> |

For additional compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md).

Expand Down
2 changes: 1 addition & 1 deletion docs/c-runtime-library/reference/stat-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ By default, this function's global state is scoped to the application. To change

The **_stat** structure, defined in SYS\STAT.H, includes the following fields.

|Field||
|Field|Description|
|-|-|
| **st_gid** | Numeric identifier of group that owns the file (UNIX-specific) This field will always be zero on Windows systems. A redirected file is classified as a Windows file. |
| **st_atime** | Time of last access of file. Valid on NTFS but not on FAT formatted disk drives. |
Expand Down
2 changes: 1 addition & 1 deletion docs/c-runtime-library/reference/umask-s.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ The **_umask_s** function sets the file-permission mask of the current process t

The integer expression *pmode* contains one or both of the following manifest constants, defined in SYS\STAT.H:

|*pmode*||
|*pmode*|Description|
|-|-|
|**_S_IWRITE**|Writing permitted.|
|**_S_IREAD**|Reading permitted.|
Expand Down
2 changes: 1 addition & 1 deletion docs/c-runtime-library/reference/umask.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ The **_umask** function sets the file-permission mask of the current process to

The integer expression *pmode* contains one or both of the following manifest constants, defined in SYS\STAT.H:

|*pmode*| |
|*pmode*|Description|
|-|-|
| **_S_IWRITE** | Writing permitted. |
| **_S_IREAD** | Reading permitted. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ The **_utime** function sets the modification time for the file specified by *fi

The **_utimbuf** structure stores file access and modification times used by **_utime** to change file-modification dates. The structure has the following fields, which are both of type **time_t**:

| Field | |
| Field | Description |
|-------|---|
| **actime** | Time of file access |
| **modtime** | Time of file modification |
Expand Down
33 changes: 20 additions & 13 deletions docs/error-messages/compiler-errors-1/compiler-error-c2276.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
---
description: "Learn more about: Compiler Error C2276"
title: "Compiler Error C2276"
ms.date: "11/04/2016"
ms.date: 03/25/2021
f1_keywords: ["C2276"]
helpviewer_keywords: ["C2276"]
ms.assetid: 62005ad9-6cb9-4b1f-965d-b875adaf695e
---
# Compiler Error C2276

'operator' : illegal operation on bound member function expression
> '*operator*' : illegal operation on bound member function expression

The compiler found a problem with the syntax to create a pointer-to-member.
The compiler found a problem with the syntax used to create a pointer-to-member.

The following sample generates C2276:
## Remarks

Error `C2276` is often caused when you attempt to create a pointer-to-member by using an instance variable to qualify the member, instead of a class type. You may also see this error if you're trying to call a member function by using the wrong syntax.

## Example

This sample shows several ways C2276 may occur, and how to fix them:

```cpp
// C2276.cpp
Expand All @@ -22,22 +27,24 @@ public:
} a;

int (*pf)() = &a.func; // C2276
// try the following line instead
// int (A::*pf3)() = &A::func;
// pf isn't qualified by the class type, and it
// tries to take a member address from an instance of A.
// Try the following line instead:
// int (A::*pf)() = &A::func;

class B {
class B : public A {
public:
void mf() {
&this -> mf; // C2276
auto x = &this -> func; // C2276
// try the following line instead
// &B::mf;
// auto x = &B::func;
}
};

int main() {
A a;
&a.func; // C2276
A a3;
auto pmf1 = &a3.func; // C2276
// try the following line instead
// &A::func;
// auto pmf1 = &A::func;
}
```
2 changes: 1 addition & 1 deletion docs/intrinsics/arm64-intrinsics.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The Microsoft C++ compiler (MSVC) makes the following intrinsics available on th

The NEON vector instruction set extensions for ARM64 provide Single Instruction Multiple Data (SIMD) capabilities. They resemble the ones in the MMX and SSE vector instruction sets that are common to x86 and x64 architecture processors.

NEON intrinsics are supported, as provided in the header file *arm64_neon.h*. The MSVC support for NEON intrinsics resembles that of the ARM64 compiler, which is documented in the [ARM NEON Intrinsic Reference](https://static.docs.arm.com/ihi0073/c/IHI0073C_arm_neon_intrinsics_ref.pdf) on the ARM Infocenter website.
NEON intrinsics are supported, as provided in the header file *arm64_neon.h*. The MSVC support for NEON intrinsics resembles that of the ARM64 compiler, which is documented in the [ARM NEON Intrinsic Reference](https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/intrinsics) on the ARM Infocenter website.

## <a name="A"></a> ARM64-specific intrinsics listing

Expand Down
Loading