Edit

Share via


Compiler errors C3000 Through C3099

The articles in this section of the documentation explain a subset of the error messages that are generated by the compiler.

Important

The Visual Studio compilers and build tools can report many kinds of errors and warnings. After an error or warning is found, the build tools may make assumptions about code intent and attempt to continue, so that more issues can be reported at the same time. If the tools make the wrong assumption, later errors or warnings may not apply to your project. When you correct issues in your project, always start with the first error or warning that's reported, and rebuild often. One fix may make many subsequent errors go away.

To get help on a particular diagnostic message in Visual Studio, select it in the Output window and press the F1 key. Visual Studio opens the documentation page for that error, if one exists. You can also use the search tool at the top of the page to find articles about specific errors or warnings. Or, browse the list of errors and warnings by tool and type in the table of contents on this page.

Note

Not every Visual Studio error or warning is documented. In many cases, the diagnostic message provides all of the information that's available. If you landed on this page when you used F1 and you think the error or warning message needs additional explanation, let us know. You can use the feedback buttons on this page to raise a documentation issue on GitHub. If you think the error or warning is wrong, or you've found another problem with the toolset, report a product issue on the Developer Community site. You can also send feedback and enter bugs within the IDE. In Visual Studio, go to the menu bar and choose Help > Send Feedback > Report a Problem, or submit a suggestion by using Help > Send Feedback > Send a Suggestion. Some compiler error topics were created that are not emitted by the compiler and now redirect to this page instead.

You may find additional assistance for errors and warnings in Microsoft Learn Q&A forums. Or, search for the error or warning number on the Visual Studio C++ Developer Community site. You can also search Stack Overflow to find solutions.

For links to additional help and community resources, see Visual C++ Help and Community.

Error messages

Error Message
Compiler error C3000 'symbol': use of class template requires template argument list. Argument deduction is not allowed in non-static data member.
Compiler error C3001 'message': expected an OpenMP directive name
Compiler error C3002 'name1 name2': multiple OpenMP directive names
Compiler error C3003 'directive': OpenMP directive name not allowed after directive clauses
Compiler error C3004 'clause': clause not valid on OpenMP 'directive' directive
Compiler error C3005 'message': unexpected token encountered on OpenMP 'directive' directive
Compiler error C3006 'clause': clause on OpenMP 'directive' directive is missing an expected argument
Compiler error C3007 'clause': clause on OpenMP 'directive' directive does not take an argument
Compiler error C3008 'argument': argument is missing closing ')' on OpenMP 'directive' directive
Compiler error C3009 'label': jump into OpenMP structured block not allowed
Compiler error C3010 'label': jump out of OpenMP structured block not allowed
Compiler error C3011 inline assembly not allowed directly within a parallel region
Compiler error C3012 'function': intrinsic function not allowed directly within a parallel region
Compiler error C3013 'clause': clause may only appear once on OpenMP 'directive' directive
Compiler error C3014 expected a for loop following OpenMP 'directive' directive
Compiler error C3015 initialization in OpenMP 'for' statement has improper form
Compiler error C3016 'identifier': index variable in OpenMP 'for' statement must have signed integral type
Compiler error C3017 termination test in OpenMP 'for' statement has improper form
Compiler error C3018 'identifier': OpenMP 'for' test or increment must use index variable 'variable'
Compiler error C3019 increment in OpenMP 'for' statement has improper form
Compiler error C3020 'variable': index variable of OpenMP 'for' loop cannot be modified in loop body
Compiler error C3021 'argument': argument is empty on OpenMP 'directive' directive
Compiler error C3022 'directive': invalid schedule kind of 'directive' on OpenMP 'directive' directive
Compiler error C3023 'argument': unexpected token encountered in argument to OpenMP 'directive' clause
Compiler error C3024 'schedule(runtime)': chunk_size expression is not allowed
Compiler error C3025 'clause': integral expression expected
Compiler error C3026 'clause': constant expression must be positive
Compiler error C3027 'clause': arithmetic or pointer expression expected
Compiler error C3028 'member': only a variable or static data member can be used in a data-sharing clause
Compiler error C3029 'symbol': can only appear once in data-sharing clauses in an OpenMP directive
Compiler error C3030 'identifier': variable in 'directive' clause/directive cannot have reference type
Compiler error C3031 'identifier': variable in 'reduction' clause must have scalar arithmetic type
Compiler error C3032 'identifier': variable in 'clause' clause cannot have incomplete type 'type'
Compiler error C3033 'identifier': variable in 'clause' clause cannot have const-qualified type
Compiler error C3034 OpenMP 'directive' directive cannot be directly nested within 'directive' directive
Compiler error C3035 OpenMP 'ordered' directive must bind directly to a 'for' or 'parallel for' directive with the 'ordered' clause
Compiler error C3036 'clause': invalid operator token in OpenMP 'reduction' clause
Compiler error C3037 'identifier': variable in 'clause' clause must be shared in enclosing context
Compiler error C3038 'identifier': variable in 'private' clause cannot be a reduction variable in enclosing context
Compiler error C3039 'identifier': index variable in OpenMP 'for' statement cannot be a reduction variable
Compiler error C3040 'identifier': type of variable in 'reduction' clause is incompatible with reduction operator 'operator'
Compiler error C3041 'identifier': variable in 'copyprivate' clause must be private in enclosing context
Compiler error C3042 'copyprivate' and 'nowait' clauses cannot appear together on OpenMP 'directive' directive
Compiler error C3043 OpenMP 'critical' directive cannot be nested in 'critical' directive with same name
Compiler error C3044 'section': only allowed directly nested under an OpenMP 'sections' directive
Compiler error C3045 Expected a compound statement following OpenMP 'sections' directive. Missing '{'
Compiler error C3046 Missing structured block in an OpenMP '#pragma omp sections' region
Compiler error C3047 Structured block in an OpenMP 'sections' region must be preceded by '#pragma omp section' (Obsolete in Visual Studio 2022.)
Compiler error C3048 Expression following '#pragma omp atomic' has improper form
Compiler error C3049 'argument': invalid argument in OpenMP 'default' clause
Compiler error C3050 'class': a ref class cannot inherit from 'identifier'
Compiler error C3051 Obsolete.
Compiler error C3052 'identifier': variable doesn't appear in a data-sharing clause under a default(none) clause
Compiler error C3053 'identifier': 'threadprivate' is only valid for global or static data items
Compiler error C3054 '#pragma omp parallel' is currently not supported in a generic class or function (Obsolete in Visual Studio 2022.)
Compiler error C3055 'identifier': symbol cannot be referenced before it is used in 'threadprivate' directive
Compiler error C3056 'identifier': symbol is not in the same scope with 'threadprivate' directive
Compiler error C3057 'identifier': dynamic initialization of 'threadprivate' symbols is not currently supported
Compiler error C3058 'identifier': symbol not declared as 'threadprivate' before it is used in the 'copyin' clause
Compiler error C3059 'identifier': 'threadprivate' symbol cannot be used in the 'clause' clause
Compiler error C3060 'identifier': a friend function may not be defined inside a class using a qualified name (it may only be declared)
Compiler error C3061 operator 'operator': not allowed on enumeration 'type' with underlying type 'type'
Compiler error C3062 'identifier': enumerator requires value since the underlying type is 'type'
Compiler error C3063 operator 'operator': all operands must have the same enumeration type
Compiler error C3064 'identifier': must be a simple type or resolve to one
Compiler error C3065 property declaration at non-class scope is not allowed
Compiler error C3066 there are multiple ways that an object of this type can be called with these arguments
Compiler error C3067 an initializer list cannot be used with the built-in operator[]
Compiler error C3068 'identifier': a 'naked' function cannot contain objects that would require unwinding if a C++ exception occurred
Compiler error C3069 operator 'operator': not allowed for enumeration type
Compiler error C3070 'identifier': property does not have a 'set' method
Compiler error C3071 operator 'operator' can only be applied to an instance of a ref class or a value-type
Compiler error C3072 operator 'operator' cannot be applied to an instance of a ref class use the unary '%' operator to convert an instance of a ref class to a handle type
Compiler error C3073 'identifier': ref class does not have a user-defined copy constructor
Compiler error C3074 an array cannot be initialized with a parenthesized initializer
Compiler error C3075 'identifier': you cannot embed an instance of a reference type, 'type', in a value-type
Compiler error C3076 'identifier': you cannot embed an instance of a reference type, 'type', in a native type
Compiler error C3077 'identifier': a finalizer can only be a member of a reference type
Compiler error C3078 array size must be specified in new expressions
Compiler error C3079 an initializer list cannot be used as the right operand of this assignment operator
Compiler error C3080 'finalizer': a finalizer cannot have a storage-class-specifier
Compiler error C3081 Obsolete.
Compiler error C3082 Obsolete.
Compiler error C3083 'identifier': the symbol to the left of a '::' must be a type
Compiler error C3084 'identifier': a destructor/finalizer cannot be 'keyword'
Compiler error C3085 'identifier': a constructor cannot be 'keyword'
Compiler error C3086 cannot find 'std::initializer_list': you need to #include <initializer_list>
Compiler error C3087 'identifier': call of 'declaration' already initializes this member
Compiler error C3088 'class': attribute constructor must have named formal arguments
Compiler error C3089 'identifier': parameter name does not match any data member's name
Compiler error C3090 'class': attribute class cannot be a template
Compiler error C3091 'class': attribute class cannot have base classes
Compiler error C3092 'class': attribute class member cannot be a bit field, 'static' or 'const'
Compiler error C3093 'type': type not allowed for attribute class member 'member'
Compiler error C3094 'attribute': anonymous usage not allowed
Compiler error C3095 'attribute': attribute cannot be repeated
Compiler error C3096 'attribute': attribute is allowed on data members of attribute classes only
Compiler error C3097 'attribute': attribute must be scoped with 'assembly:' or 'module:'
Compiler error C3098 'identifier': attribute has no user-defined constructors
Compiler error C3099 'keyword': use [System::AttributeUsageAttribute]/[Windows::Foundation::Metadata::AttributeUsageAttribute] for managed/WinRT attributes

See also

C/C++ Compiler and build tools errors and warnings
Compiler errors C2000 - C3999, C7000 - C7999