Skip to content

Structure error references in range [C1021, C1050] #5483

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-1/fatal-error-c1021.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Fatal Error C1021"
title: "Fatal Error C1021"
ms.date: "11/04/2016"
description: "Learn more about: Fatal Error C1021"
ms.date: 11/04/2016
f1_keywords: ["C1021"]
helpviewer_keywords: ["C1021"]
ms.assetid: e23171f4-ca6b-40c0-a913-a2edc6fa3766
---
# Fatal Error C1021

invalid preprocessor command 'string'
> invalid preprocessor command 'string'

## Remarks

`string` is not a valid [preprocessor directive](../../preprocessor/preprocessor-directives.md). To resolve the error, use a valid preprocessor name for `string`.

The following sample generates C1021:
## Example

The following example generates C1021:

```cpp
// C1021.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-1/fatal-error-c1022.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Fatal Error C1022"
title: "Fatal Error C1022"
ms.date: "11/04/2016"
description: "Learn more about: Fatal Error C1022"
ms.date: 11/04/2016
f1_keywords: ["C1022"]
helpviewer_keywords: ["C1022"]
ms.assetid: edada720-dc73-49bc-bd93-a7945a316312
---
# Fatal Error C1022

expected #endif
> expected #endif

## Remarks

An `#if`, `#ifdef`, or `#ifndef` directive has no matching `#endif` directive. Be sure each `#if`, `#ifdef`, or `#ifndef` has a matching `#endif`.

The following sample generates C1022:
## Example

The following example generates C1022:

```cpp
// C1022.cpp
Expand Down
9 changes: 5 additions & 4 deletions docs/error-messages/compiler-errors-1/fatal-error-c1023.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---
description: "Learn more about: Fatal Error C1023"
title: "Fatal Error C1023"
ms.date: "11/04/2016"
description: "Learn more about: Fatal Error C1023"
ms.date: 11/04/2016
f1_keywords: ["C1023"]
helpviewer_keywords: ["C1023"]
ms.assetid: 727b4070-7474-420b-ab11-6530f96c794f
---
# Fatal Error C1023

'file' : unexpected error with pch, try rebuilding the pch
> 'file' : unexpected error with pch, try rebuilding the pch

## Remarks

C1023 could be caused by one of several problems, the solution to which is a rebuild of the precompiled header file.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: "Learn more about: Fatal Error C1025, C1115"
title: "Fatal Error C1025, C1115"
description: "Learn more about: Fatal Error C1025, C1115"
ms.date: 08/17/2022
f1_keywords: ["C1025", "C1115"]
helpviewer_keywords: ["C1025", "C1115"]
Expand All @@ -9,4 +9,6 @@ helpviewer_keywords: ["C1025", "C1115"]

> too many nested lambdas

## Remarks

The compiler detected more than an internal limit for nested lambdas in the same scope. The limit is 65,535 in recent versions of Visual Studio. To resolve this issue, reduce the number of nested lambdas in the current scope.
9 changes: 5 additions & 4 deletions docs/error-messages/compiler-errors-1/fatal-error-c1026.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---
description: "Learn more about: Fatal Error C1026"
title: "Fatal Error C1026"
ms.date: "11/04/2016"
description: "Learn more about: Fatal Error C1026"
ms.date: 11/04/2016
f1_keywords: ["C1026"]
helpviewer_keywords: ["C1026"]
ms.assetid: 89bb9d40-673a-44aa-a9f4-b42c07b49d44
---
# Fatal Error C1026

parser stack overflow, program too complex
> parser stack overflow, program too complex

## Remarks

The space required to parse the program caused a compiler stack overflow.

Expand Down
9 changes: 5 additions & 4 deletions docs/error-messages/compiler-errors-1/fatal-error-c1033.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
description: "Learn more about: Fatal Error C1033"
title: "Fatal Error C1033"
ms.date: "11/04/2016"
description: "Learn more about: Fatal Error C1033"
ms.date: 11/04/2016
f1_keywords: ["C1033"]
helpviewer_keywords: ["C1033"]
ms.assetid: 09976c03-8450-4cf7-8b43-1b91c2c2b9f9
---
# Fatal Error C1033

cannot open program database pdb
> cannot open program database pdb

## Remarks

This error can be caused by a disk error, a temporary lock created by an anti-virus program, a previous debugger instance that has not fully shut down, or parallel build mspdbsrv.exe processes that attempt to access the same file, among other possible causes.
9 changes: 5 additions & 4 deletions docs/error-messages/compiler-errors-1/fatal-error-c1035.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
description: "Learn more about: Fatal Error C1035"
title: "Fatal Error C1035"
ms.date: "11/04/2016"
description: "Learn more about: Fatal Error C1035"
ms.date: 11/04/2016
f1_keywords: ["C1035"]
helpviewer_keywords: ["C1035"]
ms.assetid: 28cdccee-4377-4823-a4d8-89ca7229a83e
---
# Fatal Error C1035

expression too complex; simplify expression
> expression too complex; simplify expression

## Remarks

The compiler could not generate code for a complex expression. Split the expression into simpler expressions and recompile.
9 changes: 5 additions & 4 deletions docs/error-messages/compiler-errors-1/fatal-error-c1037.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---
description: "Learn more about: Fatal Error C1037"
title: "Fatal Error C1037"
ms.date: "11/04/2016"
description: "Learn more about: Fatal Error C1037"
ms.date: 11/04/2016
f1_keywords: ["C1037"]
helpviewer_keywords: ["C1037"]
ms.assetid: 79103bca-ccfb-42e7-aef9-9b90c15b162f
---
# Fatal Error C1037

cannot open object file filename
> cannot open object file filename

## Remarks

The object file specified by [/Fo](../../build/reference/fo-object-file-name.md) cannot be opened.

Expand Down
5 changes: 3 additions & 2 deletions docs/error-messages/compiler-errors-1/fatal-error-c1038.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
---
description: "Learn more about: Fatal Error C1038"
title: "Fatal Error C1038"
description: "Learn more about: Fatal Error C1038"
ms.date: 08/17/2022
f1_keywords: ["C1038"]
helpviewer_keywords: ["C1038"]
ms.assetid: 560dccb8-5b45-46f0-9412-caa4a6172aef
---
# Fatal Error C1038

> compiler limit : function : control flow state too complex; simplify function

## Remarks

The function has more control-flow states than the compiler can handle. Simplify control flow or split the function into smaller functions.

This error is obsolete in Visual Studio 2022 and later versions.
9 changes: 5 additions & 4 deletions docs/error-messages/compiler-errors-1/fatal-error-c1045.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
description: "Learn more about: Fatal Error C1045"
title: "Fatal Error C1045"
ms.date: "11/04/2016"
description: "Learn more about: Fatal Error C1045"
ms.date: 11/04/2016
f1_keywords: ["C1045"]
helpviewer_keywords: ["C1045"]
ms.assetid: 766c2f89-4ecd-4281-adaa-14b270cc0829
---
# Fatal Error C1045

compiler limit : linkage specifications nested too deeply
> compiler limit : linkage specifications nested too deeply

## Remarks

Nested externals exceed the compiler limit. Nested externals are allowed with the external linkage type, such as **`extern`** "C++". Reduce the number of nested externals to resolve the error.
9 changes: 5 additions & 4 deletions docs/error-messages/compiler-errors-1/fatal-error-c1046.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
description: "Learn more about: Fatal Error C1046"
title: "Fatal Error C1046"
ms.date: "11/04/2016"
description: "Learn more about: Fatal Error C1046"
ms.date: 11/04/2016
f1_keywords: ["C1046"]
helpviewer_keywords: ["C1046"]
ms.assetid: 822ec5f5-b0b0-4711-99e1-fc237b619af6
---
# Fatal Error C1046

compiler limit : structure nested too deeply
> compiler limit : structure nested too deeply

## Remarks

The structure, union, or class exceeded the nesting limit, which is 15 levels. Rewrite the definition to reduce the nesting level. Split the structure, union, or class into two or more parts by using **`typedef`** to define one or more of the nested structures.
2 changes: 1 addition & 1 deletion docs/error-messages/compiler-errors-1/fatal-error-c1047.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: "Learn more about: Fatal Error C1047"
title: "Fatal Error C1047"
description: "Learn more about: Fatal Error C1047"
ms.date: 10/22/2021
f1_keywords: ["C1047"]
helpviewer_keywords: ["C1047"]
Expand Down
4 changes: 3 additions & 1 deletion docs/error-messages/compiler-errors-1/fatal-error-c1049.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
---
title: "Fatal Error C1049"
description: "Describes compiler fatal error C1049, invalid numerical argument, and explains how to resolve it."
ms.date: "11/04/2019"
ms.date: 11/04/2019
f1_keywords: ["C1049"]
helpviewer_keywords: ["C1049"]
---
# Fatal Error C1049

> invalid numerical argument '*value*'

## Remarks

The CL.EXE command-line parser found *value* where it was expecting a numerical argument.

A C1049 error may occur when the compiler can't find a numerical argument for one of these compiler options:
Expand Down