diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3161.md b/docs/error-messages/compiler-errors-2/compiler-error-c3161.md index 2dbb59b905..f462c3b249 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3161.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3161.md @@ -1,20 +1,21 @@ --- -description: "Learn more about: Compiler Error C3161" title: "Compiler Error C3161" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3161" +ms.date: 11/04/2016 f1_keywords: ["C3161"] helpviewer_keywords: ["C3161"] -ms.assetid: 1fe2be85-a343-487b-8476-bf9e257eb29d --- # Compiler Error C3161 -'interface' : nesting class, struct, union or interface in an interface is illegal; nesting interface in a class, struct or union is illegal +> 'interface' : nesting class, struct, union or interface in an interface is illegal; nesting interface in a class, struct or union is illegal + +## Remarks An [__interface](../../cpp/interface.md) can only appear at global scope or within a namespace. A class, struct, or union cannot appear in an interface. ## Example -The following sample generates C3161. +The following example generates C3161. ```cpp // C3161.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3162.md b/docs/error-messages/compiler-errors-2/compiler-error-c3162.md index 6c059c9c65..8823e0e12e 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3162.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3162.md @@ -1,14 +1,15 @@ --- -description: "Learn more about: Compiler Error C3162" title: "Compiler Error C3162" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3162" +ms.date: 11/04/2016 f1_keywords: ["C3162"] helpviewer_keywords: ["C3162"] -ms.assetid: 0d4c4a24-1456-4191-b7d8-c38cb7b17c32 --- # Compiler Error C3162 -'type' : a reference type which has a destructor cannot be used as the type of static data member 'member' +> 'type' : a reference type which has a destructor cannot be used as the type of static data member 'member' + +## Remarks The common language runtime cannot know when to run a user-defined destructor when the class also contains static member function. @@ -22,7 +23,7 @@ For more information, see, ## Example -The following sample generates C3162. +The following example generates C3162. ```cpp // C3162.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3163.md b/docs/error-messages/compiler-errors-2/compiler-error-c3163.md index efd0231c21..f8d07d28b1 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3163.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3163.md @@ -1,15 +1,16 @@ --- -description: "Learn more about: Compiler Error C3163" title: "Compiler Error C3163" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3163" +ms.date: 11/04/2016 f1_keywords: ["C3163"] helpviewer_keywords: ["C3163"] -ms.assetid: 17dcafa3-f416-4e04-a232-f9569218ba75 --- # Compiler Error C3163 > '*construct*': attributes inconsistent with previous declaration +## Remarks + The attribute(s) that are applied to a definition conflict with the attribute(s) that are applied to a declaration. One way to resolve C3163 is to eliminate attributes on the forward declaration. Any attributes on a forward declaration should be less than the attributes on the definition or, at most, equal to them. @@ -18,7 +19,7 @@ A possible cause of the C3163 error involves the Microsoft source code annotatio ## Example -The following sample generates C3163. +The following example generates C3163. ```cpp // C3163.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3166.md b/docs/error-messages/compiler-errors-2/compiler-error-c3166.md index 6b12aa2651..4c7d4cdb3f 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3166.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3166.md @@ -1,15 +1,16 @@ --- -description: "Learn more about: Compiler Error C3166" title: "Compiler Error C3166" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3166" +ms.date: 11/04/2016 f1_keywords: ["C3166"] helpviewer_keywords: ["C3166"] -ms.assetid: ec3e330d-c15d-4158-8268-09101486c566 --- # Compiler Error C3166 > 'pointer' : cannot declare a pointer to an interior __gc pointer as a member of 'type' +## Remarks + The compiler found an invalid pointer declaration (a **`__nogc`** pointer to a **`__gc`** pointer.). C3166 is only reachable using the obsolete compiler option **`/clr:oldSyntax`**. diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3167.md b/docs/error-messages/compiler-errors-2/compiler-error-c3167.md index 32c75e4d42..62b8098408 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3167.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3167.md @@ -1,13 +1,14 @@ --- -description: "Learn more about: Compiler Error C3167" title: "Compiler Error C3167" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3167" +ms.date: 11/04/2016 f1_keywords: ["C3167"] helpviewer_keywords: ["C3167"] -ms.assetid: 58c25fe7-8562-4a18-ad3f-487f081ff173 --- # Compiler Error C3167 -Unable to initialize .NET Framework: make sure it is installed +> Unable to initialize .NET Framework: make sure it is installed + +## Remarks The .NET Framework is not installed on this computer; install the .NET Framework. diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3168.md b/docs/error-messages/compiler-errors-2/compiler-error-c3168.md index bdfd093a15..fe5c27dd2c 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3168.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3168.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C3168" title: "Compiler Error C3168" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3168" +ms.date: 11/04/2016 f1_keywords: ["C3168"] helpviewer_keywords: ["C3168"] -ms.assetid: 4c36fcfb-c351-48ff-b4eb-78d2aa1b4d55 --- # Compiler Error C3168 -'type' : illegal underlying type for enum +> 'type' : illegal underlying type for enum + +## Remarks The underlying type you specified for the **`enum`** type was not valid. The underlying type must be an integral C++ type or a corresponding CLR type. -The following sample generates C3168: +## Example + +The following example generates C3168: ```cpp // C3168.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3170.md b/docs/error-messages/compiler-errors-2/compiler-error-c3170.md index 10e9b317c4..5613a0ec2d 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3170.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3170.md @@ -1,19 +1,22 @@ --- -description: "Learn more about: Compiler Error C3170" title: "Compiler Error C3170" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3170" +ms.date: 11/04/2016 f1_keywords: ["C3170"] helpviewer_keywords: ["C3170"] -ms.assetid: ca9a59d6-7df3-42f0-b028-c09d0af3ac2a --- # Compiler Error C3170 -cannot have different module identifiers in a project +> cannot have different module identifiers in a project + +## Remarks [module](../../windows/attributes/module-cpp.md) attributes with different names were found in two of the files in a compilation. Only one unique `module` attribute can be specified per compilation. Identical `module` attributes can be specified in more than one source code file. +## Example + For example, if the following module attributes were found: ```cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3171.md b/docs/error-messages/compiler-errors-2/compiler-error-c3171.md index b51a5d11dd..63f770be44 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3171.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3171.md @@ -1,19 +1,22 @@ --- -description: "Learn more about: Compiler Error C3171" title: "Compiler Error C3171" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3171" +ms.date: 11/04/2016 f1_keywords: ["C3171"] helpviewer_keywords: ["C3171"] -ms.assetid: 1ce26997-7ef1-4c9f-84da-003ea1a4251e --- # Compiler Error C3171 -'module': cannot specify different module attributes in a project +> 'module': cannot specify different module attributes in a project + +## Remarks [module](../../windows/attributes/module-cpp.md) attributes with different parameter lists were found in two of the files in a compilation. Only one unique `module` attribute can be specified per compilation. Identical `module` attributes can be specified in more than one source code file. +## Example + For example, if the following `module` attributes were found: ```cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3172.md b/docs/error-messages/compiler-errors-2/compiler-error-c3172.md index 832aaa9c40..5bcbd0ef9e 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3172.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3172.md @@ -1,19 +1,22 @@ --- -description: "Learn more about: Compiler Error C3172" title: "Compiler Error C3172" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3172" +ms.date: 11/04/2016 f1_keywords: ["C3172"] helpviewer_keywords: ["C3172"] -ms.assetid: 1834e2fd-6036-4c33-aff2-b51bc7c99441 --- # Compiler Error C3172 -'module_name': cannot specify different idl_module attributes in a project +> 'module_name': cannot specify different idl_module attributes in a project + +## Remarks [idl_module](../../windows/attributes/idl-module.md) attributes with the same name but different `dllname` or `version` parameters were found in two of the files in a compilation. Only one unique `idl_module` attribute can be specified per compilation. Identical `idl_module` attributes can be specified in more than one source code file. +## Example + For example, if the following `idl_module` attributes were found: ```cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3173.md b/docs/error-messages/compiler-errors-2/compiler-error-c3173.md index 264132ec13..39d6159098 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3173.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3173.md @@ -1,14 +1,15 @@ --- -description: "Learn more about: Compiler Error C3173" title: "Compiler Error C3173" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3173" +ms.date: 11/04/2016 f1_keywords: ["C3173"] helpviewer_keywords: ["C3173"] -ms.assetid: edf79e10-e8cf-4f76-8d33-ab9d05e974e9 --- # Compiler Error C3173 -version mismatch in idl merge +> version mismatch in idl merge + +## Remarks This error occurs when an object file contains embedded idl that was generated with a previous version of the compiler. The compiler encodes a version number to ensure that the same compiler used to generate the idl content that is embedded in the .obj files is also the same compiler used to merge the embedded idl. diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3174.md b/docs/error-messages/compiler-errors-2/compiler-error-c3174.md index 43fbd18675..c73157a299 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3174.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3174.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C3174" title: "Compiler Error C3174" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3174" +ms.date: 11/04/2016 f1_keywords: ["C3174"] helpviewer_keywords: ["C3174"] -ms.assetid: fe6b3b5a-8196-485f-a45f-0b2e51df4086 --- # Compiler Error C3174 -module attribute was not specified +> module attribute was not specified + +## Remarks A program that uses Visual C++ attributes did not also use the [module](../../windows/attributes/module-cpp.md) attribute, which is required in any program that uses attributes. -The following sample generates C3174: +## Example + +The following example generates C3174: ```cpp // C3174.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3175.md b/docs/error-messages/compiler-errors-2/compiler-error-c3175.md index 410de47bc6..8cce6182a2 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3175.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3175.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C3175" title: "Compiler Error C3175" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3175" +ms.date: 11/04/2016 f1_keywords: ["C3175"] helpviewer_keywords: ["C3175"] -ms.assetid: 3f19d513-a05a-4b6c-806f-276fe5c36b90 --- # Compiler Error C3175 -'function1' : cannot call a method of a managed type from unmanaged function 'function2' +> 'function1' : cannot call a method of a managed type from unmanaged function 'function2' + +## Remarks Unmanaged functions cannot call member functions of managed classes. -The following sample generates C3175: +## Example + +The following example generates C3175: ```cpp // C3175_2.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3176.md b/docs/error-messages/compiler-errors-2/compiler-error-c3176.md index 9252c20ad4..dac1b4f9bd 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3176.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3176.md @@ -1,20 +1,21 @@ --- -description: "Learn more about: Compiler Error C3176" title: "Compiler Error C3176" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3176" +ms.date: 11/04/2016 f1_keywords: ["C3176"] helpviewer_keywords: ["C3176"] -ms.assetid: 6cc8d602-8e15-47a7-b1b5-e93e5d50e271 --- # Compiler Error C3176 -'type' : cannot declare local value type +> 'type' : cannot declare local value type + +## Remarks A class can only be declared as a value type at global scope. ## Example -The following sample generates C3176. +The following example generates C3176. ```cpp // C3176.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3179.md b/docs/error-messages/compiler-errors-2/compiler-error-c3179.md index 3ae78d152d..20752c024d 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3179.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3179.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C3179" title: "Compiler Error C3179" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3179" +ms.date: 11/04/2016 f1_keywords: ["C3179"] helpviewer_keywords: ["C3179"] -ms.assetid: 60d7e41b-25fd-48ac-8b79-830c062f4dcd --- # Compiler Error C3179 -an unnamed managed or WinRT type is not allowed +> an unnamed managed or WinRT type is not allowed + +## Remarks All CLR and WinRT classes and structs must have names. -The following sample generates C3179 and shows how to fix it: +## Example + +The following example generates C3179 and shows how to fix it: ```cpp // C3179a.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3180.md b/docs/error-messages/compiler-errors-2/compiler-error-c3180.md index 7c795d0066..c5e39e638b 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3180.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3180.md @@ -1,14 +1,15 @@ --- -description: "Learn more about: Compiler Error C3180" title: "Compiler Error C3180" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3180" +ms.date: 11/04/2016 f1_keywords: ["C3180"] helpviewer_keywords: ["C3180"] -ms.assetid: 5281f583-7df7-418a-8507-d4da67ed6572 --- # Compiler Error C3180 -'type name' : name exceeds meta-data limit of 'limit' characters +> 'type name' : name exceeds meta-data limit of 'limit' characters + +## Remarks The compiler truncated the name for a managed type in metadata. The truncation will make the type unusable with the `#using` directive (or the equivalent in another language). diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3181.md b/docs/error-messages/compiler-errors-2/compiler-error-c3181.md index 1af9f7eccf..4c71262029 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3181.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3181.md @@ -1,20 +1,23 @@ --- -description: "Learn more about: Compiler Error C3181" title: "Compiler Error C3181" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3181" +ms.date: 11/04/2016 f1_keywords: ["C3181"] helpviewer_keywords: ["C3181"] -ms.assetid: 5d450f8b-6cef-4452-a0c4-2076e967451d --- # Compiler Error C3181 -'type' : invalid operand for operator +> 'type' : invalid operand for operator + +## Remarks An invalid parameter was passed to the [typeid](../../extensions/typeid-cpp-component-extensions.md) operator. The parameter must be a managed type. Note that the compiler uses aliases for native types that map to types in the common language runtime. -The following sample generates C3181: +## Example + +The following example generates C3181: ```cpp // C3181a.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3182.md b/docs/error-messages/compiler-errors-2/compiler-error-c3182.md index 9c3772dff9..5682244822 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3182.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3182.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C3182" title: "Compiler Error C3182" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3182" +ms.date: 11/04/2016 f1_keywords: ["C3182"] helpviewer_keywords: ["C3182"] -ms.assetid: f3681266-308e-4990-a979-8eef8920e186 --- # Compiler Error C3182 -'class' : a member using-declaration or access declaration is illegal within a managed or WinRTtype +> 'class' : a member using-declaration or access declaration is illegal within a managed or WinRTtype + +## Remarks A [using](../../cpp/using-declaration.md) declaration is invalid within all forms of managed classes. -The following sample generates C3182 and shows how to fix it. +## Example + +The following example generates C3182 and shows how to fix it. ```cpp // C3182a.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3183.md b/docs/error-messages/compiler-errors-2/compiler-error-c3183.md index 82ad13cdc5..c23ae7054a 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3183.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3183.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C3183" title: "Compiler Error C3183" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3183" +ms.date: 11/04/2016 f1_keywords: ["C3183"] helpviewer_keywords: ["C3183"] -ms.assetid: dbd0f020-c739-43c9-947e-9ce21537331b --- # Compiler Error C3183 -cannot define unnamed class, struct or union inside of managed or WinRT type 'type' +> cannot define unnamed class, struct or union inside of managed or WinRT type 'type' + +## Remarks A type that is embedded in a managed or WinRT type must be named. -The following sample generates C3183: +## Example + +The following example generates C3183: ```cpp // C3183a.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3185.md b/docs/error-messages/compiler-errors-2/compiler-error-c3185.md index 315365082c..a4b6c832e3 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3185.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3185.md @@ -7,11 +7,15 @@ helpviewer_keywords: ["C3185"] --- # Compiler Error C3185 -'typeid' used on managed or WinRT type 'type', use 'operator' instead +> 'typeid' used on managed or WinRT type 'type', use 'operator' instead + +## Remarks You cannot apply the [typeid](../../cpp/typeid-operator.md) operator to a managed or WinRT type; use [typeid](../../extensions/typeid-cpp-component-extensions.md) instead. -The following sample generates C3185 and shows how to fix it: +## Example + +The following example generates C3185 and shows how to fix it: ```cpp // C3185a.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3189.md b/docs/error-messages/compiler-errors-2/compiler-error-c3189.md index 6197c274ae..90248e7515 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3189.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3189.md @@ -1,20 +1,23 @@ --- -description: "Learn more about: Compiler Error C3189" title: "Compiler Error C3189" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3189" +ms.date: 11/04/2016 f1_keywords: ["C3189"] helpviewer_keywords: ["C3189"] -ms.assetid: b254de79-931e-4a59-a9f4-1c690d90ca5e --- # Compiler Error C3189 > 'typeid\': this syntax is no longer supported, use ::typeid instead +## Remarks + An obsolete form of [typeid](../../extensions/typeid-cpp-component-extensions.md) was used, use the new form. This error is obsolete in Visual Studio 2022 and later versions. -The following sample generates C3189: +## Example + +The following example generates C3189: ```cpp // C3189.cpp diff --git a/docs/error-messages/compiler-errors-2/compiler-error-c3190.md b/docs/error-messages/compiler-errors-2/compiler-error-c3190.md index a1fd356cb1..3b55ad91f4 100644 --- a/docs/error-messages/compiler-errors-2/compiler-error-c3190.md +++ b/docs/error-messages/compiler-errors-2/compiler-error-c3190.md @@ -1,18 +1,21 @@ --- -description: "Learn more about: Compiler Error C3190" title: "Compiler Error C3190" -ms.date: "11/04/2016" +description: "Learn more about: Compiler Error C3190" +ms.date: 11/04/2016 f1_keywords: ["C3190"] helpviewer_keywords: ["C3190"] -ms.assetid: 7c701afa-85a7-4f7a-8881-0662436ac244 --- # Compiler Error C3190 -'instantiation' with the provided template arguments is not the explicit instantiation of any member function of 'type' +> 'instantiation' with the provided template arguments is not the explicit instantiation of any member function of 'type' + +## Remarks The compiler detected an attempt to make an explicit function instantiation; however, the provided type arguments do not match any of the possible functions. -The following sample generates C3190: +## Example + +The following example generates C3190: ```cpp // C3190.cpp