Skip to content

Commit 0b92c75

Browse files
Merge pull request #6232 from MicrosoftDocs/main
Auto Publish – main to live - 2026-01-28 18:30 UTC
2 parents 8f51746 + f38b79e commit 0b92c75

46 files changed

Lines changed: 505 additions & 380 deletions

Some content is hidden

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

docs/build/projects-and-build-systems-cpp.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,56 @@
11
---
22
title: "C/C++ projects and build systems in Visual Studio"
33
description: "Use Visual Studio to compile and build C++ projects for Windows, ARM, or Linux based on any project system."
4-
ms.date: "07/17/2019"
5-
helpviewer_keywords: ["builds [C++]", "C++ projects, building", "projects [C++], building", "builds [C++], options", "C++, build options"]
6-
ms.assetid: fa6ed4ff-334a-4d99-b5e2-a1f83d2b3008
4+
ms.date: 07/17/2019
75
ms.topic: "overview"
86
ms.custom: intro-overview
7+
helpviewer_keywords: ["builds [C++]", "C++ projects, building", "projects [C++], building", "builds [C++], options", "C++, build options"]
98
---
109
# C/C++ projects and build systems in Visual Studio
1110

1211
You can use Visual Studio to edit, compile, and build any C++ code base with full IntelliSense support without having to convert that code into a Visual Studio project or compile with the Microsoft C++ (MSVC) Build Tools. For example, you can edit a cross-platform CMake project in Visual Studio on a Windows machine, then compile it for Linux using g++ on a remote Linux machine.
1312

1413
## C++ compilation
1514

16-
To *build* a C++ program means to compile source code from one or more files and then link those files into an executable file (.exe), a dynamic-load library (.dll) or a static library (.lib).
15+
To *build* a C++ program means to compile source code from one or more files and then link those files into an executable file (`.exe`), a dynamic-link library (`.dll`) or a static library (`.lib`).
1716

1817
Basic C++ compilation involves three main steps:
1918

2019
- The C++ preprocessor transforms all the #directives and macro definitions in each source file. This creates a *translation unit*.
21-
- The C++ compiler compiles each translation unit into object files (.obj), applying whatever compiler options have been set.
20+
- The C++ compiler compiles each translation unit into object files (`.obj`), applying whatever compiler options have been set.
2221
- The *linker* merges the object files into a single executable, applying the linker options that have been set.
2322

2423
## The Microsoft C++ (MSVC) Build Tools
2524

2625
The Microsoft C++ compiler, linker, standard libraries, and related utilities make up the Microsoft C++ (MSVC) Build Tools (also called a toolchain or toolset). These are included in Visual Studio. You can also download and use the command-line toolset as a free standalone package. For more information, see [Build Tools for Visual Studio](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022) on the Visual Studio Downloads page.
2726

28-
You can build simple programs by invoking the MSVC compiler (cl.exe) directly from the command line. The following command accepts a single source code file, and invokes cl.exe to build an executable called *hello.exe*:
27+
You can build simple programs by invoking the MSVC compiler (`cl.exe`) directly from the command line. The following command accepts a single source code file, and invokes `cl.exe` to build an executable called *`hello.exe`*:
2928

3029
```cmd
3130
cl /EHsc hello.cpp
3231
```
3332

34-
Here the compiler (cl.exe) automatically invokes the C++ preprocessor and the linker to produce the final output file. For more information, see [Building on the command line](building-on-the-command-line.md).
33+
Here the compiler (`cl.exe`) automatically invokes the C++ preprocessor and the linker to produce the final output file. For more information, see [Building on the command line](building-on-the-command-line.md).
3534

3635
## Build systems and projects
3736

3837
Most real-world programs use some kind of *build system* to manage complexities of compiling multiple source files for multiple configurations (debug vs. release), multiple platforms (x86, x64, ARM, and so on), custom build steps, and even multiple executables that must be compiled in a certain order. You make settings in a build configuration file(s), and the build system accepts that file as input before it invokes the compiler. The set of source code files and build configuration files needed to build an executable file is called a *project*.
3938

4039
The following list shows various options for Visual Studio Projects - C++:
4140

42-
- create a Visual Studio project by using the Visual Studio IDE and configure it by using property pages. Visual Studio projects produce programs that run on Windows. For an overview, see [Compiling and Building](/visualstudio/ide/compiling-and-building-in-visual-studio) in the Visual Studio documentation.
41+
- Create a Visual Studio project by using the Visual Studio IDE and configure it by using property pages. Visual Studio projects produce programs that run on Windows. For an overview, see [Compiling and Building](/visualstudio/ide/compiling-and-building-in-visual-studio) in the Visual Studio documentation.
4342

44-
- open a folder that contains a CMakeLists.txt file. CMake support is integrated into Visual Studio. You can use the IDE to edit, test, and debug without modifying the CMake files in any way. This enables you to work in the same CMake project as others who might be using different editors. CMake is the recommended approach for cross-platform development. For more information, see [CMake projects](cmake-projects-in-visual-studio.md).
43+
- Open a folder that contains a `CMakeLists.txt` file. CMake support is integrated into Visual Studio. You can use the IDE to edit, test, and debug without modifying the CMake files in any way. This enables you to work in the same CMake project as others who might be using different editors. CMake is the recommended approach for cross-platform development. For more information, see [CMake projects](cmake-projects-in-visual-studio.md).
4544

46-
- open a loose folder of source files with no project file. Visual Studio will use heuristics to build the files. This is an easy way to compile and run small console applications. For more information, see [Open Folder projects](open-folder-projects-cpp.md).
45+
- Open a loose folder of source files with no project file. Visual Studio will use heuristics to build the files. This is an easy way to compile and run small console applications. For more information, see [Open Folder projects](open-folder-projects-cpp.md).
4746

48-
- open a folder that contains a makefile, or any other build system configuration file. You can configure Visual Studio to invoke any arbitrary build commands by adding JSON files to the folder. For more information, see [Open Folder projects](open-folder-projects-cpp.md).
47+
- Open a folder that contains a makefile, or any other build system configuration file. You can configure Visual Studio to invoke any arbitrary build commands by adding JSON files to the folder. For more information, see [Open Folder projects](open-folder-projects-cpp.md).
4948

5049
- Open a Windows makefile in Visual Studio. For more information, see [NMAKE Reference](reference/nmake-reference.md).
5150

5251
## MSBuild from the command line
5352

54-
You can invoke MSBuild from the command line by passing it a .vcxproj file along with command-line options. This approach requires a good understanding of MSBuild, and is recommended only when necessary. For more information, see [MSBuild](msbuild-visual-cpp.md).
53+
You can invoke MSBuild from the command line by passing it a `.vcxproj` file along with command-line options. This approach requires a good understanding of MSBuild, and is recommended only when necessary. For more information, see [MSBuild](msbuild-visual-cpp.md).
5554

5655
## In This Section
5756

@@ -74,7 +73,7 @@ Discusses how to use the C/C++ compiler and build tools directly from the comman
7473
How to create, debug, and deploy C/C++ DLLs (shared libraries) in Visual Studio.
7574

7675
[Walkthrough: Creating and Using a Static Library](walkthrough-creating-and-using-a-static-library-cpp.md)\
77-
How to create a **.lib** binary file.
76+
How to create a `.lib` binary file.
7877

7978
[Building C/C++ Isolated Applications and Side-by-side Assemblies](building-c-cpp-isolated-applications-and-side-by-side-assemblies.md)\
8079
Describes the deployment model for Windows Desktop applications, based on the idea of isolated applications and side-by-side assemblies.
@@ -86,7 +85,7 @@ How to target 64-bit x64 hardware with the MSVC build tools.
8685
How to use the MSVC Build Tools to target ARM hardware.
8786

8887
[Optimizing Your Code](optimizing-your-code.md)\
89-
How to optimize your code in various ways including program guided optimizations.
88+
How to optimize your code in various ways including profile-guided optimization (PGO).
9089

9190
[Configuring Programs for Windows XP](configuring-programs-for-windows-xp.md)\
9291
How to target Windows XP with the MSVC build tools.

docs/build/reference/zc-conformance.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Here are the **`/Zc`** compiler options:
3030
| [`/Zc:checkGwOdr[-]`](zc-check-gwodr.md) | Enforce Standard C++ ODR violations under `/Gw`. |
3131
| [`/Zc:enumTypes[-]`](zc-enumtypes.md) | Enable Standard C++ rules for `enum` type deduction. Off by default. |
3232
| [`/Zc:externC[-]`](zc-externc.md) | Enforce Standard C++ rules for `extern "C"` functions. Off by default unless **`/permissive-`** is specified. |
33-
| [`/Zc:externConstexpr[-]`](zc-externconstexpr.md) | Enable external linkage for **`constexpr`** variables. Off by default. |
33+
| [`/Zc:externConstexpr[-]`](zc-externconstexpr.md) | Enable external linkage for **`constexpr`** variables. Off by default unless **`/permissive-`** is specified. |
3434
| [`/Zc:forScope[-]`](zc-forscope-force-conformance-in-for-loop-scope.md) | Enforce Standard C++ **`for`** scoping rules. On by default. |
3535
| [`/Zc:gotoScope[-]`](zc-gotoscope.md) | Enforce Standard C++ **`goto`** rules around local variable initialization. Off by default unless **`/permissive-`** is specified. |
3636
| [`/Zc:hiddenFriend[-]`](zc-hiddenfriend.md) | Enforce Standard C++ hidden friend rules. Off by default unless **`/permissive-`** is specified. |

docs/data/odbc/recordset-fetching-records-in-bulk-odbc.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
---
2-
description: "Learn more about: Recordset: Fetching Records in Bulk (ODBC)"
32
title: "Recordset: Fetching Records in Bulk (ODBC)"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Recordset: Fetching Records in Bulk (ODBC)"
4+
ms.date: 11/04/2016
55
helpviewer_keywords: ["bulk row fetching, implementing", "ODBC recordsets, bulk row fetching", "bulk record field exchange", "bulk row fetching", "bulk RFX functions", "recordsets, bulk row fetching", "DoBulkFieldExchange method", "fetching ODBC records in bulk", "RFX (ODBC), bulk", "rowsets, bulk row fetching", "RFX (ODBC), bulk row fetching"]
6-
ms.assetid: 20d10fe9-c58a-414a-b675-cdf9aa283e4f
76
---
87
# Recordset: Fetching Records in Bulk (ODBC)
98

@@ -74,7 +73,7 @@ public:
7473
.
7574
.
7675
.
77-
}
76+
};
7877
```
7978

8079
You can either allocate these storage buffers manually or have the framework do the allocation. To allocate the buffers yourself, you must specify the `CRecordset::userAllocMultiRowBuffers` option of the *dwOptions* parameter in the `Open` member function. Be sure to set the sizes of the arrays at least equal to the rowset size. If you want to have the framework do the allocation, you should initialize your pointers to NULL. This is typically done in the recordset object's constructor:
Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,38 @@
11
---
22
title: "Compiler Error C2135"
33
description: "Learn more about: Compiler Error C2135"
4-
ms.date: 11/04/2016
4+
ms.date: 08/13/2025
55
f1_keywords: ["C2135"]
66
helpviewer_keywords: ["C2135"]
77
---
88
# Compiler Error C2135
99

10-
> 'bit operator' : illegal bit field operation
10+
> '*identifier*': you cannot apply '*operator*' to a bit-field
1111
1212
## Remarks
1313

14-
The address-of operator (`&`) cannot be applied to a bit field.
14+
The [address-of operator (`&`)](../../cpp/address-of-operator-amp.md), [unary plus operator (`+`)](../../cpp/unary-plus-and-negation-operators-plus-and.md), [unary negation operator (`-`)](../../cpp/unary-plus-and-negation-operators-plus-and.md), [logical negation operator (`!`)](../../cpp/logical-negation-operator-exclpt.md), [one's complement operator (`~`)](../../cpp/one-s-complement-operator-tilde.md), and [indirection operator (`*`)](../../cpp/indirection-operator-star.md) cannot be applied to a bit-field in this context.
1515

1616
## Example
1717

1818
The following example generates C2135:
1919

2020
```cpp
2121
// C2135.cpp
22-
struct S {
23-
int i : 1;
24-
};
2522

26-
struct T {
27-
int j;
23+
struct S
24+
{
25+
int bit_field : 1;
26+
int integer;
2827
};
29-
int main() {
30-
&S::i; // C2135 address of a bit field
31-
&T::j; // OK
28+
29+
int main()
30+
{
31+
&S::bit_field; // C2135
32+
&S::integer; // OK
3233
}
3334
```
35+
36+
## See also
37+
38+
[C2104](compiler-error-c2104.md)
Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Compiler Error C2178"
33
description: "Learn more about: Compiler Error C2178"
4-
ms.date: 05/08/2017
4+
ms.date: 08/11/2025
55
f1_keywords: ["C2178"]
66
helpviewer_keywords: ["C2178"]
77
---
@@ -11,23 +11,41 @@ helpviewer_keywords: ["C2178"]
1111
1212
## Remarks
1313

14-
A **`mutable`** specifier was used in a declaration, but the specifier is not allowed in this context.
14+
A **`mutable`** specifier was used in a declaration, but the specifier is not allowed in this context. It can only be applied to non-static, non-const, and non-reference data members. For more information, see [Mutable Data Members](../../cpp/mutable-data-members-cpp.md).
1515

16-
The **`mutable`** specifier can be applied only to names of class data members, and cannot be applied to names declared **`const`** or **`static`**, and cannot be applied to reference members.
16+
A **`consteval`** specifier was used on a [destructor](../../cpp/destructors-cpp.md), allocation function, or deallocation function.
1717

18-
## Example
18+
## Example: `mutable`
1919

20-
The following example shows how C2178 may occur, and how to fix it.
20+
The following example shows how C2178 may occur with the **`mutable`** specifier, and how to resolve it:
2121

2222
```cpp
23-
// C2178.cpp
24-
// compile with: cl /c /W4 C2178.cpp
23+
// C2178_mutable.cpp
24+
// compile with: /c
2525

26-
class S {
27-
mutable const int i; // C2178
28-
// To fix, declare either const or mutable, not both.
26+
struct S
27+
{
28+
mutable const int i; // C2178, remove mutable or const to resolve
2929
};
3030

31-
mutable int x = 4; // C2178
32-
// To fix, remove mutable keyword
31+
mutable int x = 4; // C2178, remove mutable to resolve
32+
```
33+
34+
## Example: `consteval`
35+
36+
The following example shows how C2178 may occur with the **`consteval`** specifier. To resolve this error, remove all **`consteval`** specifiers:
37+
38+
```cpp
39+
// C2178_consteval.cpp
40+
// compile with: /c /std:c++20
41+
42+
#include <cstddef>
43+
44+
struct S
45+
{
46+
consteval ~S() {} // C2178
47+
48+
consteval static void* operator new(std::size_t size); // C2178
49+
consteval static void operator delete(void* ptr); // C2178
50+
};
3351
```
Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Compiler Error C2190"
33
description: "Learn more about: Compiler Error C2190"
4-
ms.date: 11/04/2016
4+
ms.date: 08/22/2025
55
f1_keywords: ["C2190"]
66
helpviewer_keywords: ["C2190"]
77
---
@@ -11,7 +11,7 @@ helpviewer_keywords: ["C2190"]
1111
1212
## Remarks
1313

14-
A C function was declared a second time with a shorter parameter list. C does not support overloaded functions.
14+
A C function was declared a second time with a shorter parameter list. C does not support overloaded functions. Without [`/Za`](../../build/reference/za-ze-disable-language-extensions.md), the compiler emits [Compiler Warning (level 1) C4030](../compiler-warnings/compiler-warning-level-1-c4030.md) instead.
1515

1616
## Example
1717

@@ -20,7 +20,13 @@ The following example generates C2190:
2020
```c
2121
// C2190.c
2222
// compile with: /Za /c
23-
void func( int, float );
24-
void func( int ); // C2190, different parameter list
25-
void func2( int ); // OK
23+
24+
void func1(int, float);
25+
void func1(int); // C2190, shorter parameter list
26+
27+
void func2(int); // OK
2628
```
29+
30+
## See also
31+
32+
[Compiler Error C2191](compiler-error-c2191.md)
Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Compiler Error C2191"
33
description: "Learn more about: Compiler Error C2191"
4-
ms.date: 11/04/2016
4+
ms.date: 08/22/2025
55
f1_keywords: ["C2191"]
66
helpviewer_keywords: ["C2191"]
77
---
@@ -11,7 +11,7 @@ helpviewer_keywords: ["C2191"]
1111
1212
## Remarks
1313

14-
A C function was declared a second time with a longer parameter list. C does not support overloaded functions.
14+
A C function was declared a second time with a longer parameter list. C does not support overloaded functions. Without [`/Za`](../../build/reference/za-ze-disable-language-extensions.md), the compiler emits [Compiler Warning (level 1) C4031](../compiler-warnings/compiler-warning-level-1-c4031.md) instead.
1515

1616
## Example
1717

@@ -20,7 +20,13 @@ The following example generates C2191:
2020
```c
2121
// C2191.c
2222
// compile with: /Za /c
23-
void func( int );
24-
void func( int, float ); // C2191 different parameter list
25-
void func2( int, float ); // OK
23+
24+
void func1(int);
25+
void func1(int, float); // C2191, longer parameter list
26+
27+
void func2(int, float); // OK
2628
```
29+
30+
## See also
31+
32+
[Compiler Error C2190](compiler-error-c2190.md)
Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
11
---
22
title: "Compiler Error C2277"
33
description: "Learn more about: Compiler Error C2277"
4-
ms.date: 11/04/2016
4+
ms.date: 08/27/2025
55
f1_keywords: ["C2277"]
66
helpviewer_keywords: ["C2277"]
77
---
88
# Compiler Error C2277
99

10-
> 'identifier' : cannot take address of this member function
10+
> '*function*': cannot take address of this member function
1111
1212
## Remarks
1313

14-
You cannot take the address of a member function.
14+
You cannot take the address of a [constructor](../../cpp/constructors-cpp.md) or [destructor](../../cpp/destructors-cpp.md). For more information, see [Address-of operator: `&`](../../cpp/address-of-operator-amp.md) and [Pointers to Members](../../cpp/pointers-to-members.md).
1515

1616
## Example
1717

1818
The following example generates C2277:
1919

2020
```cpp
21-
// C2277.cpp
22-
class A {
21+
// compile with: /c
22+
23+
class A
24+
{
2325
public:
2426
A();
2527
};
26-
(*pctor)() = &A::A; // C2277
28+
(*pctor)() = &A::A; // C2277
2729
```

docs/error-messages/compiler-errors-2/compiler-error-c2698.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ struct B {
3030
struct C : A, B {
3131
using A::x;
3232
using B::x; // C2698
33-
}
33+
};
3434
```
Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,31 @@
11
---
2-
description: "Learn more about: Compiler Error C3083"
32
title: "Compiler Error C3083"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C3083"
4+
ms.date: 08/14/2025
55
f1_keywords: ["C3083"]
66
helpviewer_keywords: ["C3083"]
7-
ms.assetid: 05ff791d-52bb-41eb-9511-3ef89d7f4710
87
---
98
# Compiler Error C3083
109

11-
'function': the symbol to the left of a '::' must be a type
10+
> '*identifier*': the symbol to the left of a '::' must be a type
1211
13-
A function was called incorrectly.
12+
## Remarks
13+
14+
The qualification used is invalid. Ensure that no extra symbols were used in the qualification and that you included all required headers.
1415

1516
## Example
1617

17-
The following sample generates C3083.
18+
The following example generates C3083:
1819

1920
```cpp
2021
// C3083.cpp
2122
// compile with: /c
22-
struct N {
23-
~N();
24-
};
2523

26-
struct N1 {
27-
~N1();
24+
struct S
25+
{
26+
S();
2827
};
2928

30-
N::N::~N() {} // C3083
31-
N1::~N1() {} // OK
29+
S::Extra::S() {} // C3083
30+
S::S() {} // OK
3231
```

0 commit comments

Comments
 (0)