Redigera

Dela via


Compiler errors C3400 Through C3499

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 C3400 circular constraint dependency involving 'constraint1' and 'constraint2'
Compiler error C3401 'specifier': invalid assembly access specifier - only 'private' is allowed on class templates
Compiler error C3402 'function': cannot resolve overload except in the current scope
Compiler error C3403 thread_local cannot be used with /clr:pure or /clr:safe
Compiler error C3404 'construct': unexpected syntax error
Compiler error C3405 'function': cannot resolve overload without complete descriptor
Compiler error C3406 'keyword': cannot be used in an elaborated type specifier
Compiler error C3407 'type' cannot be used in this context
Compiler error C3408 'attribute': attribute is not allowed on template definitions
Compiler error C3409 empty attribute block is not allowed
Compiler error C3410 'identifier': the type of the explicit instantiation 'type' does not match the type of the variable template 'type'
Compiler error C3411 'type' is not valid as the size of an array as it is not an integer type
Compiler error C3412 'specialization': cannot specialize template in current scope
Compiler error C3413 'template': invalid explicit instantiation
Compiler error C3414 'function': imported member function can't be defined
Compiler error C3415 multiple 'section' sections found with different attributes ('0xvalue')
Compiler error C3416 Obsolete.
Compiler error C3417 'declarator': value types cannot contain user-defined special member functions
Compiler error C3418 access specifier 'specifier' is not supported
Compiler error C3419 Obsolete.
Compiler error C3420 'function': a finalizer cannot be virtual
Compiler error C3421 'function': you cannot call the finalizer for this class as it is either inaccessible or it does not exist
Compiler error C3422 'declaration': mismatched types 'type' and 'type'
Compiler error C3423 Obsolete.
Compiler error C3424 'type': a function-style cast to an array type is not allowed
Compiler error C3425 cannot throw pointer to object of incomplete type 'type'
Compiler error C3426 cannot throw object of incomplete type 'type'
Compiler error C3427 'context': 'keyword' cannot be used with layout_version(number)
Compiler error C3428 'context': 'keyword' can only be applied to class declarations or definitions
Compiler error C3429 'context': 'keyword' cannot be applied to a union
Compiler error C3430 a scoped enumeration must have a name
Compiler error C3431 'identifier': type1 cannot be redeclared as type2
Compiler error C3432 'identifier': a forward declaration of an unscoped enumeration must have an underlying type
Compiler error C3433 'identifier': all declarations of an enumeration must have the same underlying type, was 'type1' now 'type2'
Compiler error C3434 'context': enumerator value 'number' cannot be represented as 'type', value is 'number'
Compiler error C3435 character set 'name' is not supported.
Compiler error C3436 #pragma setlocale is not supported when /source-charset, /execution-charset, or /utf-8 has been specified
Compiler error C3437 #pragma execution_character_set is not supported when /source-charset, /execution-charset, or /utf-8 has been specified
Compiler error C3438 'context': 'value' cannot be applied to a managed/WinRT class
Compiler error C3439 layout_version(number): invalid version number
Compiler error C3440 'declaration': layout_version(number) incompatible with a prior declaration
Compiler error C3441 'declaration': 'keyword' cannot be applied after the class has been defined
Compiler error C3442 Initializing multiple members of union: 'member1' and 'member2'
Compiler error C3443 The default member initializer for 'class' is recursive
Compiler error C3444 Empty aggregate class 'class' must be initialized with '{}'
Compiler error C3445 copy-list-initialization of 'type' cannot use an explicit constructor
Compiler error C3446 'class': a default member initializer is not allowed for a member of a value class
Compiler error C3447 operand to the conditional operator ?: is of type 'void', but the other-operand is neither a throw-expression nor of type 'void'
Compiler error C3448 the number of identifiers must match the number of array elements or members in a structured binding declaration
Compiler error C3449 the number of identifiers must match the value of std::tuple_size<type-name>::value in a structured binding of tuple-like type
Compiler error C3450 'type': not an attribute; cannot specify [System::AttributeUsageAttribute]/[Windows::Foundation::Metadata::AttributeUsageAttribute]
Compiler error C3451 'attribute': cannot apply unmanaged attribute to 'type'
Compiler error C3452 list argument member not constant
Compiler error C3453 'attribute': attribute not applied because qualifier 'qualifier' did not match
Compiler error C3454 [attribute] not allowed on class declaration
Compiler error C3455 'attribute': none of the attribute constructors matched the arguments
Compiler error C3456 [source-annotation-attribute] not allowed on managed/WinRT class declaration
Compiler error C3457 'attribute': attribute does not support unnamed arguments
Compiler error C3458 '[attribute]': attribute '[attribute]' already specified for 'identifier'
Compiler error C3459 '[attribute]': attribute allowed only on class indexer (default indexed property)
Compiler error C3460 'type': only a user-defined type can be forwarded
Compiler error C3461 'type': only a managed/WinRT type can be forwarded
Compiler error C3462 'type': only an imported type can be forwarded
Compiler error C3463 'type': type not allowed in attribute 'implements'
Compiler error C3464 'type' a nested type cannot be forwarded
Compiler error C3465 to use type 'type' you must reference the assembly 'assembly'
Compiler error C3466 'type': a specialization of a generic class cannot be forwarded
Compiler error C3467 'type': this type has already been forwarded
Compiler error C3468 'type': you can only forward a type to an assembly: 'identifier' is not an assembly
Compiler error C3469 'type': a generic class cannot be forwarded
Compiler error C3470 'class': a class cannot have both an indexer (default indexed property) and an operator[]
Compiler error C3471 new module name module-name (set on command line) conflicts with previous name module-name
Compiler error C3472 new output file name filename (set on command line) conflicts with previous file name filename
Compiler error C3473 no output pathname or module name specified.
Compiler error C3474 could not open output file 'filename'
Compiler error C3475 syntax error in input file 'filename'
Compiler error C3476 could not open file 'filename' for input
Compiler error C3477 a lambda cannot appear in an unevaluated context
Compiler error C3478 'identifier': an array cannot be captured by copy
Compiler error C3479 SAL annotations on lambdas are not supported
Compiler error C3480 'variable': a lambda capture variable must be from an enclosing function scope
Compiler error C3481 'identifier': lambda capture variable not found
Compiler error C3482 'this' can only be used as a lambda capture within a non-static member function
Compiler error C3483 'identifier' is already part of the lambda capture list
Compiler error C3484 syntax error: expected '->' before the return type
Compiler error C3485 a lambda definition cannot have any cv-qualifiers (Obsolete in Visual Studio 2022.)
Compiler error C3486 a parameter for a lambda cannot have a default argument (Obsolete in Visual Studio 2022.)
Compiler error C3487 'type': all return expressions must deduce to the same type: previously it was 'type'
Compiler error C3488 '&identifier' is not allowed when the default capture mode is by-reference
Compiler error C3489 '&identifier' is required when the default capture mode is by copy
Compiler error C3490 'identifier' cannot be modified because it is being accessed through a const object
Compiler error C3491 'identifier': a by copy capture cannot be modified in a non-mutable lambda
Compiler error C3492 'identifier': you cannot capture a member of an anonymous union
Compiler error C3493 'identifier' cannot be implicitly captured because no default capture mode has been specified
Compiler error C3494 'this' cannot be explicitly captured because an enclosing capture mode does not allow it
Compiler error C3495 'identifier': identifier in capture must be a variable with automatic storage duration declared in the reaching scope of the lambda
Compiler error C3496 'this' is always captured by value: '&' ignored
Compiler error C3497 you cannot construct an instance of a lambda
Compiler error C3498 'identifier': you cannot capture a variable that has a managed/WinRT type
Compiler error C3499 a lambda that has been specified to have a void return type cannot return a value

See also

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