Compiler errors C3100 Through C3199

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.

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 C3100 'identifier': unknown attribute qualifier
Compiler error C3101 illegal expression for named attribute argument 'identifier'
Compiler error C3102 Obsolete.
Compiler error C3103 'identifier': repeated named argument
Compiler error C3104 illegal attribute argument
Compiler error C3105 'symbol': cannot be used as an attribute
Compiler error C3106 'attribute': unnamed arguments must precede named arguments
Compiler error C3107 'attribute': member functions of native attributes cannot be defined
Compiler error C3108 cannot deduce a type as an initializer list is not an expression
Compiler error C3109 'identifier': interface methods must use either the '__stdcall' or '__cdecl' calling convention
Compiler error C3110 'function': you cannot overload a COM interface method
Compiler error C3111 An initializer list cannot be used as the default argument for a template parameter
Compiler error C3112 'interface': an interface can only be declared at global or namespace scope
Compiler error C3113 an 'interface/enum' cannot be a template/generic
Compiler error C3114 'identifier': not a valid named attribute argument
Compiler error C3115 'attribute': this attribute is not allowed on 'construct'
Compiler error C3116 'specifier': invalid storage class for interface method
Compiler error C3117 'interface': an interface can only have one base class
Compiler error C3118 'interface': interfaces do not support virtual inheritance
Compiler error C3119 alignas(void) is not allowed
Compiler error C3120 'identifier': interface methods cannot take a variable argument list
Compiler error C3121 cannot change GUID for class 'class'
Compiler error C3122 'interface': a WinRT generic interface cannot have GUID
Compiler error C3123 WinRT generic interface cannot have constraints
Compiler error C3124 'signed char' is not a valid WinRT data type. Use 'unsigned char', 'wchar_t' or 'signed short' instead.
Compiler error C3125 'type': type cannot directly or indirectly derive from 'Platform::Exception'
Compiler error C3126 cannot define a union 'union' inside of managed/WinRT type 'type'
Compiler error C3127 'type': 'trait' trait can only be used on a WinRT ref class
Compiler error C3128 'type' does not have a vtable that was introduced by 'type'
Compiler error C3129 'type': __default_vptr_for_base can only be used on locally defined polymorphic types and bases
Compiler error C3130 Internal Compiler error: failed to write injected code block to PDB
Compiler error C3131 project must have a 'module' attribute with a 'name' property
Compiler error C3132 'parameter': parameter arrays can only be applied to a formal argument of type 'single-dimensional managed/WinRT array'
Compiler error C3133 Attributes cannot be applied to C++ varargs
Compiler error C3134 'value': value of attribute argument 'argument' does not have valid type 'type'
Compiler error C3135 'identifier': a property cannot have a 'const' or 'volatile' type
Compiler error C3136 'interface': a COM interface can only inherit from another COM interface, 'interface' is not a COM interface
Compiler error C3137 'identifier': a property cannot be initialized
Compiler error C3138 'identifier': a 'attribute' interface must inherit from IDispatch, or from an interface that inherits from IDispatch
Compiler error C3139 'type': cannot export a UDT without members
Compiler error C3140 cannot have multiple 'module' attributes in the same compilation unit
Compiler error C3141 'interface': interfaces only support public inheritance
Compiler error C3142 'property': you cannot take the address of a property
Compiler error C3143 'argument': attribute argument cannot have multiple values
Compiler error C3144 'attribute': attribute requires explicit arguments, 'argument' is unnamed
Compiler error C3145 'identifier': global or static variable may not have managed/WinRT type 'type'
Compiler error C3146 Obsolete.
Compiler error C3147 Obsolete.
Compiler error C3148 Obsolete.
Compiler error C3149 'type': cannot use this type here without a top-level 'token'
Compiler error C3150 'construct': 'attribute' can only be applied to a class, struct, interface, array or pointer
Compiler error C3151 Obsolete.
Compiler error C3152 'function': 'keyword' can only be applied to a class, struct, or virtual member function
Compiler error C3153 'interface': you cannot create an instance of an interface
Compiler error C3154 Expected ',' before ellipsis. Non-comma separated ellipsis not supported on parameter array functions.
Compiler error C3155 attributes are not allowed in a property indexer
Compiler error C3156 'class': you cannot have a local definition of a managed/WinRT type
Compiler error C3157 ParamArray attribute can only be applied to the last parameter
Compiler error C3158 'function': 'keyword' can only be applied to a virtual member function
Compiler error C3159 'identifier': array of pointers to value type cannot be declared
Compiler error C3160 'type': a data member of a managed/WinRT class cannot have this type
Compiler error C3161 'interface': nesting class, struct, or interface in an interface is illegal; nesting interface in a class or struct is illegal
Compiler error C3162 'type': a reference type which has a destructor cannot be used as the type of static data member 'member'
Compiler error C3163 'class': attributes inconsistent with previous declaration
Compiler error C3164 Obsolete.
Compiler error C3165 'value': cannot convert to an integral or floating point value
Compiler error C3166 Obsolete. 'type': a data member of a managed/WinRT class cannot have type 'pointer_type to interior managed_pointer_type'
Compiler error C3167 Unable to initialize .NET Framework: make sure it is installed
Compiler error C3168 'type': illegal underlying type for enum
Compiler error C3169 'type': cannot deduce type for 'auto' from 'type'
Compiler error C3170 cannot have different module identifiers in a project
Compiler error C3171 'module': cannot specify different module attributes in a project
Compiler error C3172 'identifier': cannot specify different idl_module attributes in a project
Compiler error C3173 version mismatch in idl merge
Compiler error C3174 module attribute was not specified
Compiler error C3175 'function': cannot call a method of a managed type from unmanaged function 'function'
Compiler error C3176 'type': cannot declare local value type
Compiler error C3177 you cannot have a conversion function to a type that contains 'type' (Obsolete in Visual Studio 2022.)
Compiler error C3178 'type': cannot use ParamArray in a function with default arguments (Obsolete in Visual Studio 2022.)
Compiler error C3179 an unnamed managed/WinRT type is not allowed
Compiler error C3180 'type': name exceeds meta-data limit of 'number' characters
Compiler error C3181 'type': invalid operand for operator
Compiler error C3182 'type': a member using-declaration or access declaration is illegal within a managed/WinRT type
Compiler error C3183 cannot define unnamed class, struct or union inside of managed/WinRT type 'class'
Compiler error C3184 Obsolete.
Compiler error C3185 'typeid': used on managed/WinRT type 'type', use 'operator' instead
Compiler error C3186 Obsolete.
Compiler error C3187 'identifier': is only available within the body of a function
Compiler error C3188 Obsolete.
Compiler error C3189 'typeid<declarator>': this syntax is no longer supported, use::typeid instead (Obsolete in Visual Studio 2022.)
Compiler error C3190 'declarator' with the provided template arguments is not the explicit instantiation of any member function of 'type'
Compiler error C3191 Obsolete.
Compiler error C3192 syntax error: '^' is not a prefix operator (did you mean '*'?)
Compiler error C3193 'construct': requires '/clr' or '/ZW' command line option
Compiler error C3194 'type': a value-type cannot have an assignment operator
Compiler error C3195 'keyword': is reserved and cannot be used as a member of a ref class or value type. CLR/WinRT operators must be defined using the 'operator' keyword
Compiler error C3196 'identifier': used more than once
Compiler error C3197 'keyword': can only be used in definitions
Compiler error C3198 invalid use of floating-point pragmas: fenv_access pragma operates only in precise mode
Compiler error C3199 invalid use of floating-point pragmas: exceptions are not supported in non-precise mode

See also

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