Skip to content

Commit 2690850

Browse files
Merge pull request #5644 from Rageking8/structure-error-references-in-range-c2851-c2880
Structure error references in range [C2851, C2880]
2 parents 26c4722 + 4bb41b2 commit 2690850

25 files changed

+160
-113
lines changed

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C2854"
32
title: "Compiler Error C2854"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2854"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2854"]
66
helpviewer_keywords: ["C2854"]
7-
ms.assetid: 917fec9c-790a-4149-8dfc-00d17a09199c
87
---
98
# Compiler Error C2854
109

11-
syntax error in #pragma hdrstop
10+
> syntax error in #pragma hdrstop
11+
12+
## Remarks
1213

1314
The `#pragma hdrstop` gives an invalid filename. The pragma can be followed by an optional filename in parentheses and quotation marks:
1415

15-
The following sample generates C2854:
16+
## Example
17+
18+
The following example generates C2854:
1619

1720
```cpp
1821
// C2854.cpp

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
description: "Learn more about: Compiler Error C2855"
32
title: "Compiler Error C2855"
3+
description: "Learn more about: Compiler Error C2855"
44
ms.date: 02/16/2021
55
f1_keywords: ["C2855"]
66
helpviewer_keywords: ["C2855"]
@@ -9,10 +9,10 @@ helpviewer_keywords: ["C2855"]
99

1010
> command-line option '*option*' inconsistent with precompiled header
1111
12-
This error occurs when a command-line option differs from the options used to create the precompiled header.
13-
1412
## Remarks
1513

14+
This error occurs when a command-line option differs from the options used to create the precompiled header.
15+
1616
Error C2855 can occur when you make an incremental build after changing a compiler option. It can also happen if you set specific compiler options for individual source files.
1717

1818
To resolve this error, regenerate the precompiled header by using the specified command-line option. To regenerate the precompiled header, build the associated source file. For example, projects created by a Visual Studio template usually create a source file named *`pch.cpp`* to generate the precompiled header. (In older versions of Visual Studio, this file is named *`stdafx.cpp`*.) In other projects, the source file to rebuild is the one built by using the [`/Yc` (Create precompiled header file)](../../build/reference/yc-create-precompiled-header-file.md) compiler option. We recommend you rebuild your entire project after making a change to the precompiled header.

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
---
2-
description: "Learn more about: Compiler Error C2856"
32
title: "Compiler Error C2856"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2856"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2856"]
66
helpviewer_keywords: ["C2856"]
7-
ms.assetid: fe616c51-124e-49e3-9dd8-883ec1660680
87
---
98
# Compiler Error C2856
109

11-
\#pragma hdrstop cannot be inside an #if block
10+
> #pragma hdrstop cannot be inside an #if block
11+
12+
## Remarks
1213

1314
The `hdrstop` pragma cannot be placed inside the body of a conditional compilation block.
1415

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
11
---
2-
description: "Learn more about: Compiler Error C2857"
32
title: "Compiler Error C2857"
4-
ms.date: "09/13/2018"
3+
description: "Learn more about: Compiler Error C2857"
4+
ms.date: 09/13/2018
55
f1_keywords: ["C2857"]
66
helpviewer_keywords: ["C2857"]
7-
ms.assetid: b57302bd-58ec-45ae-992a-1e282d5eeccc
87
---
98
# Compiler Error C2857
109

1110
> '#include' statement specified with the /Yc*filename* command-line option was not found in the source file
1211
13-
The [/Yc](../../build/reference/yc-create-precompiled-header-file.md) option specifies the name of an include file that is not included in the source file being compiled.
14-
1512
## Remarks
1613

14+
The [/Yc](../../build/reference/yc-create-precompiled-header-file.md) option specifies the name of an include file that is not included in the source file being compiled.
15+
1716
When you use the **/Yc**<em>filename</em> option on a source file to create a precompiled header (PCH) file, that source file must include the *filename* header file. Every file included by the source file, up to and including the specified *filename*, is included in the PCH file. In other source files compiled by using the **/Yu**<em>filename</em> option to use the PCH file, an include of *filename* must be the first non-comment line in the file. The compiler ignores anything in the source file before this include.
1817

1918
This error can be caused by an `#include "filename"` statement in a conditional compilation block that is not compiled in your PCH source file.
2019

2120
## Example
2221

23-
In typical usage, one source file in your project is designated as the PCH source file, and one header file is used as the PCH header file. A typical PCH header file has all of the library headers used in your project, but not local headers that are still under development. In this sample, the PCH header file is named *my_pch.h*.
22+
In typical usage, one source file in your project is designated as the PCH source file, and one header file is used as the PCH header file. A typical PCH header file has all of the library headers used in your project, but not local headers that are still under development. In this example, the PCH header file is named *my_pch.h*.
2423

2524
```cpp
2625
// my_pch.h
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
---
2-
description: "Learn more about: Compiler Error C2858"
32
title: "Compiler Error C2858"
3+
description: "Learn more about: Compiler Error C2858"
44
ms.date: 06/01/2022
55
f1_keywords: ["C2858"]
66
helpviewer_keywords: ["C2858"]
7-
ms.assetid: 1fb1d770-307e-476e-9984-a1d8f8ce2820
87
---
98
# Compiler Error C2858
109

1110
> command-line option '/Yc (/Fd*filename1*)' inconsistent with precompiled header, which used '/Fd*filename2*'
1211
12+
## Remarks
13+
1314
The program database specified by the Use Precompiled Header ([`/Yu`](../../build/reference/yu-use-precompiled-header-file.md)) option is not the one specified by the previous Create Precompiled Header ([`/Yc`](../../build/reference/yc-create-precompiled-header-file.md)) option.
1415

1516
This error is obsolete in Visual Studio 2022 and later versions.

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
---
2-
description: "Learn more about: Compiler Error C2859"
32
title: "Compiler Error C2859"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2859"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2859"]
66
helpviewer_keywords: ["C2859"]
7-
ms.assetid: fcfbc58d-08f6-4752-9688-8aaac517e684
87
---
98
# Compiler Error C2859
109

11-
filename is not the type file that was used when this precompiled header was created, recreate the precompiled header.
10+
> filename is not the type file that was used when this precompiled header was created, recreate the precompiled header.
11+
12+
## Remarks
1213

1314
The project database and precompiled header files must be created together to ensure consistent information. Rebuild the project to recreate the precompiled header.
1415

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C2860"
32
title: "Compiler Error C2860"
4-
ms.date: "03/16/2024"
3+
description: "Learn more about: Compiler Error C2860"
4+
ms.date: 03/16/2024
55
f1_keywords: ["C2860"]
66
helpviewer_keywords: ["C2860"]
77
---
88
# Compiler Error C2860
99

10-
'void' cannot be used as a function parameter except for '(void)'
10+
> 'void' cannot be used as a function parameter except for '(void)'
11+
12+
## Remarks
1113

1214
A function parameter cannot be of type **`void`**.
1315

14-
The following sample generates C2860:
16+
## Example
17+
18+
The following example generates C2860:
1519

1620
```cpp
1721
// C2860.cpp

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C2861"
32
title: "Compiler Error C2861"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2861"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2861"]
66
helpviewer_keywords: ["C2861"]
7-
ms.assetid: 012bb44d-6c9b-4def-b54e-b19f1f8ddd1b
87
---
98
# Compiler Error C2861
109

11-
'function name' : an interface member function cannot be defined
10+
> 'function name' : an interface member function cannot be defined
11+
12+
## Remarks
1213

1314
The compiler encountered the interface keyword or deduced a struct as an interface but then found a member function definition. An interface cannot contain a definition for a member function.
1415

1516
## Example
1617

17-
The following sample generates C2861:
18+
The following example generates C2861:
1819

1920
```cpp
2021
// C2861.cpp

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C2862"
32
title: "Compiler Error C2862"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2862"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2862"]
66
helpviewer_keywords: ["C2862"]
7-
ms.assetid: c04d8499-b799-48a1-9fb4-7902a0b0ac8e
87
---
98
# Compiler Error C2862
109

11-
'interface' : an interface can only have public members
10+
> 'interface' : an interface can only have public members
11+
12+
## Remarks
1213

1314
Protected and private members may be accessed only from other member functions. Such members are no use in an interface, since it may not provide implementations for any of its members.
1415

15-
The following sample will generate C2862:
16+
## Example
17+
18+
The following example will generate C2862:
1619

1720
```cpp
1821
// C2862.cpp

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C2863"
32
title: "Compiler Error C2863"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2863"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2863"]
66
helpviewer_keywords: ["C2863"]
7-
ms.assetid: 32561d67-a795-486b-b3b6-4b90a1acb176
87
---
98
# Compiler Error C2863
109

11-
'interface' : an interface cannot have friends
10+
> 'interface' : an interface cannot have friends
11+
12+
## Remarks
1213

1314
Declaring friends on an interface is not allowed.
1415

15-
The following sample generates C2863:
16+
## Example
17+
18+
The following example generates C2863:
1619

1720
```cpp
1821
// C2863.cpp

0 commit comments

Comments
 (0)