Edit

Share via


Compiler errors C3200 Through C3299

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 C3200 'type': invalid template argument for template parameter 'parameter', expected a class template
Compiler error C3201 the template parameter list for class template 'template' does not match the template parameter list for template parameter 'parameter'
Compiler error C3202 'identifier': invalid default argument, expected a class template
Compiler error C3203 'identifier': unspecialized class template/generic can't be used as a template/generic argument for template/generic parameter 'parameter', expected a real type
Compiler error C3204 'function' cannot be called from within a catch block
Compiler error C3205 argument list for template template parameter 'identifier' is missing
Compiler error C3206 'function': invalid template/generic argument for 'template', missing template/generic argument list on class template/generic 'type'
Compiler error C3207 'function': invalid template argument for 'parameter', class template expected
Compiler error C3208 'function': template parameter list for class template 'template' does not match template parameter list for template template parameter 'parameter'
Compiler error C3209 'type': generic class must be a managed/WinRT class
Compiler error C3210 'identifier': access declaration can only be applied to a base class member
Compiler error C3211 'function': explicit specialization is using partial specialization syntax, use template <> instead
Compiler error C3212 'function': an explicit specialization of a template member must be a member of an explicit specialization
Compiler error C3213 base class 'class' is less accessible than 'derived_class'
Compiler error C3214 'argument': invalid type argument for generic parameter 'parameter' of generic 'type', does not meet constraint 'constraint'
Compiler error C3215 'constraint1': generic type parameter already constrained by 'constraint2'
Compiler error C3216 constraint must be a generic parameter, not 'type'
Compiler error C3217 'parameter': generic parameter cannot be constrained in this declaration
Compiler error C3218 'type': type not allowed as a constraint
Compiler error C3219 'parameter': generic parameter cannot be constrained by multiple non-interfaces: 'type'
Compiler error C3220 'interface': interface cannot have progid
Compiler error C3221 'member': multiple 'default' and 'case' attributes not allowed on a member
Compiler error C3222 'function': cannot declare default arguments for member functions of a managed/WinRT type or generic functions
Compiler error C3223 'property': you cannot apply 'typeid' to a property
Compiler error C3224 'type': no overloaded generic class takes 'number' generic type arguments
Compiler error C3225 generic type argument for 'argument' cannot be 'type', it must be a value type or a handle to a reference type
Compiler error C3226 A template declaration is not allowed inside a generic declaration
Compiler error C3227 'type': cannot use 'operator' to allocate a generic type
Compiler error C3228 'function': generic type argument for 'argument' cannot be 'type', it must be a value type or handle type
Compiler error C3229 'type': indirections on a generic type parameter are not allowed
Compiler error C3230 'function': template type argument for 'argument' cannot contain a generic type parameter: 'type'
Compiler error C3231 'type': template type argument cannot use a generic type parameter
Compiler error C3232 'parameter': a generic type parameter cannot be used in a qualified name
Compiler error C3233 'type': generic type parameter already constrained
Compiler error C3234 a generic class may not derive from a generic type parameter
Compiler error C3235 'specialization': explicit or partial specialization of a generic class is not allowed
Compiler error C3236 explicit instantiation of a generic is not allowed
Compiler error C3237 'class': a generic class cannot be a custom attribute
Compiler error C3238 'type': a type with this name has already been forwarded to assembly 'assembly'
Compiler error C3239 'type': pointer to interior/pin pointer is disallowed by the common language runtime
Compiler error C3240 'identifier': must be a non-overloaded abstract member function of 'type'
Compiler error C3241 'member': this method was not introduced by 'interface'
Compiler error C3242 'function': you can only explicitly override virtual functions
Compiler error C3243 none of the overload functions were introduced by 'interface'
Compiler error C3244 'member': this method was introduced by 'interface1' not by 'interface2'
Compiler error C3245 'function': use of a variable template requires template argument list
Compiler error C3246 'class': cannot inherit from 'base_class' as it has been declared as 'inheritance'
Compiler error C3247 'coclass': a coclass cannot inherit from another coclass 'base_class'
Compiler error C3248 Obsolete. 'function': function declared as 'sealed' cannot be overridden by 'function'
Compiler error C3249 illegal statement or sub-expression for 'constexpr' function (Obsolete in Visual Studio 2022.)
Compiler error C3250 'declaration': declaration is not allowed in 'constexpr' function body (Obsolete in Visual Studio 2022.)
Compiler error C3251 cannot invoke base class method on a value type instance (Obsolete in Visual Studio 2022.)
Compiler error C3252 'function': cannot reduce accessibility of a virtual method in a managed/WinRT type
Compiler error C3253 'function': error with explicit override
Compiler error C3254 'function': class contains explicit override 'function' but does not derive from an interface that contains the function declaration
Compiler error C3255 'type': cannot dynamically allocate this value type object on native heap
Compiler error C3256 'function': variable use does not produce a constant expression (Obsolete in Visual Studio 2022.)
Compiler error C3257 Obsolete.
Compiler error C3258 Obsolete.
Compiler error C3259 'constexpr' functions can only have one return statement (Obsolete in Visual Studio 2022.)
Compiler error C3260 'token': skipping unexpected token(s) before lambda body
Compiler error C3261 a function returning a managed/WinRT array must have array brackets at the end of the declaration: 'identifier(...) []'
Compiler error C3262 invalid array indexing: number dimension(s) specified for number-dimensional 'type'
Compiler error C3263 Obsolete.
Compiler error C3264 'identifier': a class-constructor cannot have a return type
Compiler error C3265 cannot declare a managed 'managed_construct' in an unmanaged 'unmanaged_construct'
Compiler error C3266 'function': a class-constructor must have a 'void' parameter list
Compiler error C3267 Obsolete.
Compiler error C3268 'function': a generic function or a member-function of a generic class cannot have a variable parameter list
Compiler error C3269 'function': a member-function of a managed/WinRT type cannot be declared with '...'
Compiler error C3270 'field': the FieldOffset attribute can only be used in the context of StructLayout(LayoutKind::Explicit)
Compiler error C3271 'field': invalid value 'number' for the FieldOffset attribute
Compiler error C3272 'symbol': symbol requires FieldOffset, as it is a member of struct/class type_name defined with StructLayout(LayoutKind::Explicit)
Compiler error C3273 'keyword': not allowed on C++ try block
Compiler error C3274 finally / __finally without matching try
Compiler error C3275 'identifier': cannot use this symbol without qualifier (Obsolete in Visual Studio 2022.)
Compiler error C3276 'keyword': jump out of finally/__finally block has undefined behavior during termination handling
Compiler error C3277 cannot define an unmanaged enum 'enumeration' inside managed 'type'
Compiler error C3278 direct call of interface or pure method 'function' will fail at runtime
Compiler error C3279 partial and explicit specializations as well as explicit instantiations of class templates declared in the cli namespace are disallowed
Compiler error C3280 'function': a member-function of a managed type cannot be compiled as an unmanaged function
Compiler error C3281 'function': global operator cannot have managed/WinRT type 'type' in signature
Compiler error C3282 generic parameter lists can only appear on managed/WinRT classes, structs, or functions
Compiler error C3283 'interface': an interface cannot have an instance constructor
Compiler error C3284 the constraints for generic parameter 'parameter' of function 'declarator' must match the constraints for generic parameter 'parameter' of function 'declarator'
Compiler error C3285 for each statement cannot operate on variables of type 'type'
Compiler error C3286 'specifier': an iteration variable cannot have any storage-class specifiers
Compiler error C3287 the type 'type' (return type of GetEnumerator) must have a suitable public MoveNext member function and public Current property
Compiler error C3288 'type': illegal dereference of a handle type
Compiler error C3289 'identifier': a trivial property cannot be indexed
Compiler error C3290 'type': a trivial property cannot have reference type
Compiler error C3291 'default': cannot be the name of a trivial property
Compiler error C3292 the cli namespace cannot be reopened
Compiler error C3293 'identifier': use 'default' to access the default property (indexer) for class 'class'
Compiler error C3294 Obsolete.
Compiler error C3295 '#pragma specifier' can only be used at global or namespace scope
Compiler error C3296 'identifier': a property with this name already exists
Compiler error C3297 ' constraint2': cannot use ' constraint1' as a constraint because ' constraint1' has the value constraint
Compiler error C3298 ' constraint1': cannot use ' constraint2' as a constraint because ' constraint2' has the ref constraint and ' constraint1' has the value constraint
Compiler error C3299 ' function': cannot specify constraints, they are inherited from the base method

See also

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