Skip to content

Commit 4ac0335

Browse files
author
Colin Robertson
authored
Fix link errors in error-messages (MicrosoftDocs#90)
1 parent 65e7a7b commit 4ac0335

11 files changed

Lines changed: 31 additions & 32 deletions

docs/error-messages/compiler-warnings/compiler-warning-c4950.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,14 @@ translation.priority.mt:
3838
# Compiler Warning C4950
3939
'type_or_member' : marked as obsolete
4040

41-
A member or type was marked as obsolete with the [ObsoleteAttribute](frlrfSystemObsoleteAttributeClassTopic).
41+
A member or type was marked as obsolete with the <xref:System.ObsoleteAttribute> attribute.
4242

43-
C4950 is always issued as an error. You can turn off this warning with the `#pragma warning` or **/wd**; see [warning](../../preprocessor/warning.md) or [/w, /W0, /W1, /W2, /W3, /W4, /w1, /w2, /w3, /w4, /Wall, /wd, /we, /wo, /Wv, /WX (Warning Level)](../../build/reference/compiler-option-warning-level.md) for more information.
43+
C4950 is always issued as an error. You can turn off this warning by using the [warning](../../preprocessor/warning.md) pragma directive or the [/wd](../../build/reference/compiler-option-warning-level.md) compiler option.
4444

45-
The following sample generates C4950:
45+
## Example
46+
The following sample generates C4950:
4647

47-
```
48+
```cpp
4849
// C4950.cpp
4950
// compile with: /clr
5051
using namespace System;

docs/error-messages/compiler-warnings/compiler-warning-level-1-and-3-c4793.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ translation.priority.ht:
5656
|--------------------|-------------|
5757
|Aligned data types are not supported in managed code|The CLR must be able to allocate data as needed, which might not be possible if the data is aligned with declarations such as [__m128](../../cpp/m128.md) or [align](../../cpp/align-cpp.md).|
5858
|Functions that use '__ImageBase' are not supported in managed code|`__ImageBase` is a special linker symbol that is typically used only by low-level native code to load a DLL.|
59-
|varargs are not supported by the '/clr' compiler option|Native functions cannot call managed functions that have [variable argument lists](../../misc/variable-argument-lists.md) (varargs) because the functions have different stack layout requirements. However, if you specify the `/clr:pure` compiler option, variable argument lists are supported because the assembly can contain only managed functions. For more information, see [Pure and Verifiable Code (C++/CLI)](../../dotnet/pure-and-verifiable-code-cpp-cli.md).|
59+
|varargs are not supported by the '/clr' compiler option|Native functions cannot call managed functions that have [variable argument lists](../../cpp/functions-with-variable-argument-lists-cpp.md) (varargs) because the functions have different stack layout requirements. However, if you specify the `/clr:pure` compiler option, variable argument lists are supported because the assembly can contain only managed functions. For more information, see [Pure and Verifiable Code (C++/CLI)](../../dotnet/pure-and-verifiable-code-cpp-cli.md).|
6060
|The 64-bit CLR does not support data declared with the __ptr32 modifier|A pointer must be the same size as a native pointer on the current platform. For more information, see [__ptr32, \__ptr64](../../cpp/ptr32-ptr64.md).|
6161
|The 32-bit CLR does not support data declared with the __ptr64 modifier|A pointer must be the same size as a native pointer on the current platform. For more information, see [__ptr32, \__ptr64](../../cpp/ptr32-ptr64.md).|
6262
|One or more intrinsics is not supported in managed code|The name of the intrinsic is not available at the time the message is emitted. However, an intrinsic that causes this message typically represents a low-level machine instruction.|

docs/error-messages/compiler-warnings/compiler-warning-level-1-c4165.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@ manager: "ghogen"
2323
# Compiler Warning (level 1) C4165
2424
'HRESULT' is being converted to 'bool'; are you sure this is what you want?
2525

26-
When using an [HRESULT](_com_hresults) in an [if](../../cpp/if-else-statement-cpp.md) statement, the HRESULT will be converted to a [bool](../../cpp/bool-cpp.md) unless you explicitly test for the variable as an HRESULT. This warning is off by default.
26+
When using an HRESULT in an [if](../../cpp/if-else-statement-cpp.md) statement, the HRESULT will be converted to a [bool](../../cpp/bool-cpp.md) unless you explicitly test for the variable as an HRESULT. This warning is off by default.
2727

28-
The following sample generates C4165
28+
## Example
29+
The following sample generates C4165
2930

30-
```
31+
```cpp
3132
// C4165.cpp
3233
// compile with: /W1
3334
#include <windows.h>

docs/error-messages/compiler-warnings/compiler-warning-level-1-c4190.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ translation.priority.ht:
3737
# Compiler Warning (level 1) C4190
3838
'identifier1' has C-linkage specified, but returns UDT 'identifier2' which is incompatible with C
3939

40-
A function or pointer to function has a UDT (user-defined type, which is a class, structure, enum, union, or [__value](../../misc/value.md) type) as return type and `extern` "C" linkage. This is legal if:
40+
A function or pointer to function has a UDT (user-defined type, which is a class, structure, enum, or union) as return type and `extern` "C" linkage. This is legal if:
4141

4242
- All calls to this function occur from C++.
4343

4444
- The definition of the function is in C++.
4545

4646
## Example
4747

48-
```
48+
```cpp
4949
// C4190.cpp
5050
// compile with: /W1 /LD
5151
struct X

docs/error-messages/compiler-warnings/compiler-warning-level-1-c4274.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,13 @@ manager: "ghogen"
2626
The `#ident` directive, which inserts a user-specified string in the object or executable file, is deprecated. Consequently, the compiler ignores the directive.
2727

2828
> [!CAUTION]
29-
> Warning C4274 advises you to use the [#pragma comment(exestr, 'string')](../../preprocessor/comment-c-cpp.md) directive. However, this advice is deprecated and will be revised in a future release of the compiler. If you use the `#pragma` directive, the linker tool (LINK.exe) ignores the comment record produced by the directive and issues warning [LNK4229](../../error-messages/tool-errors/linker-tools-warning-lnk4229.md). Instead of the `#ident` directive, we recommend that you use a [file version resource string](_win32_Version_Information) in your application.
29+
> Warning C4274 advises you to use the [#pragma comment(exestr, 'string')](../../preprocessor/comment-c-cpp.md) directive. However, this advice is deprecated and will be revised in a future release of the compiler. If you use the `#pragma` directive, the linker tool (LINK.exe) ignores the comment record produced by the directive and issues warning [LNK4229](../../error-messages/tool-errors/linker-tools-warning-lnk4229.md). Instead of the `#ident` directive, we recommend that you use a file version resource string in your application.
3030
31-
### To correct this error
31+
## To correct this error
3232

3333
- Remove the `#ident "`*string*`"` directive.
3434

3535
## See Also
3636
[comment (C/C++)](../../preprocessor/comment-c-cpp.md)
3737
[Linker Tools Warning LNK4229](../../error-messages/tool-errors/linker-tools-warning-lnk4229.md)
38-
[Version Information](_win32_Version_Information)
3938
[Working with Resource Files](../../mfc/working-with-resource-files.md)

docs/error-messages/compiler-warnings/compiler-warning-level-1-c4917.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,14 @@ translation.priority.ht:
3737
# Compiler Warning (level 1) C4917
3838
'declarator' : a GUID can only be associated with a class, interface or namespace
3939

40-
A user-defined structure other than [class](../../cpp/class-cpp.md), [interface](../../cpp/interface.md), or [namespace](../../misc/namespace-declaration.md) cannot have a GUID.
40+
A user-defined structure other than [class](../../cpp/class-cpp.md), [interface](../../cpp/interface.md), or [namespace](../../cpp/namespaces-cpp.md) cannot have a GUID.
4141

42-
This warning is off by default. See [Compiler Warnings That Are Off by Default](../../preprocessor/compiler-warnings-that-are-off-by-default.md) for more information.
42+
This warning is off by default. See [Compiler Warnings That Are Off by Default](../../preprocessor/compiler-warnings-that-are-off-by-default.md) for more information.
4343

44-
The following code sample generates C4917:
44+
## Example
45+
The following code sample generates C4917:
4546

46-
```
47+
```cpp
4748
// C4917.cpp
4849
// compile with: /W1
4950
#pragma warning(default : 4917)

docs/error-messages/compiler-warnings/compiler-warning-level-1-c4947.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,12 @@ translation.priority.mt:
3838
# Compiler Warning (level 1) C4947
3939
'type_or_member' : marked as obsolete
4040

41-
A member or type was marked as obsolete with the [ObsoleteAttribute](frlrfSystemObsoleteAttributeClassTopic) class.
41+
A member or type was marked as obsolete with the <xref:System.ObsoleteAttribute> class.
4242

43-
The following sample generates C4947:
43+
## Example
44+
The following sample generates C4947:
4445

45-
```
46+
```cpp
4647
// C4947.cpp
4748
// compile with: /clr /W1
4849
// C4947 expected

docs/error-messages/compiler-warnings/compiler-warnings-c4200-through-c4399.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ The articles in this part of the documentation contain information about a subse
189189
|[Compiler Warning (level 1) C4346](../../error-messages/compiler-warnings/compiler-warning-level-1-c4346.md)|'name': dependent name is not a type|
190190
|[Compiler Warning (level 1) C4348](../../error-messages/compiler-warnings/compiler-warning-level-1-c4348.md)|'type': redefinition of default parameter: parameter 'parameter_number'|
191191
|[Compiler Warning (level 1) C4350](../../error-messages/compiler-warnings/compiler-warning-level-1-c4350.md)|behavior change: 'member1' called instead of 'member2'|
192-
|[Compiler Warning (level 1) C4351](../Topic/Compiler%20Warning%20\(level%201\)%20C4351.md)|new behavior: elements of array 'array' will be default initialized|
193192
|Compiler warning (level 1) C4352|'%$I': intrinsic function already defined|
194193
|[Compiler Warning (level 1) C4353](../../error-messages/compiler-warnings/compiler-warning-level-1-c4353.md)|nonstandard extension used: constant 0 as function expression. Use '__noop' function intrinsic instead|
195194
|[Compiler Warning C4355](../../error-messages/compiler-warnings/compiler-warning-c4355.md)Compiler warning (level 1 and level 4) C4355|'this': used in base member initializer list|

docs/error-messages/compiler-warnings/compiler-warnings-c4400-through-c4599.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ The articles in this part of the documentation contain information about a subse
200200
|[Compiler Warning (level 4) C4536](../../error-messages/compiler-warnings/compiler-warning-level-4-c4536.md)|'typename': type-name exceeds meta-data limit of 'character_limit' characters|
201201
|[Compiler Warning (level 1) C4537](../../error-messages/compiler-warnings/compiler-warning-level-1-c4537.md)|'object': '.' applied to non-UDT type|
202202
|[Compiler Warning (level 3) C4538](../../error-messages/compiler-warnings/compiler-warning-level-3-c4538.md)|'type': const/volatile qualifiers on this type are not supported|
203-
|[Compiler Warning (level 1) C4539](../Topic/Compiler%20Warning%20\(level%201\)%20C4539.md)|'character': a universal-character-name specifies an invalid character|
204203
|[Compiler Warning (level 1) C4540](../../error-messages/compiler-warnings/compiler-warning-level-1-c4540.md)|dynamic_cast used to convert to inaccessible or ambiguous base; run-time test will fail ('type1' to 'type2')|
205204
|[Compiler Warning (level 1) C4541](../../error-messages/compiler-warnings/compiler-warning-level-1-c4541.md)|'identifier' used on polymorphic type 'type' with /GR-; unpredictable behavior may result|
206205
|Compiler warning (level 1) C4542|Skipping generation of merged injected text file, cannot write %$M file: '%s': %$e|

docs/error-messages/tool-errors/linker-tools-error-lnk2005.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,17 @@ translation.priority.ht:
3737
# Linker Tools Error LNK2005
3838
symbol already defined in object
3939

40-
The given `symbol`, displayed in its decorated form, was multiply defined.
40+
The given `symbol`, displayed in its decorated form, was multiply defined.
4141

42-
For more information, see the Knowledge Base articles:
42+
For more information, see the Knowledge Base articles:
4343

44-
- "LNK2005 Errors When Link C Run-Time Libraries Are Linked Before MFC Libraries" (Q148652)
44+
- [A LNK2005 error occurs when the CRT library and MFC libraries are linked in the wrong order in Visual C++](https://support.microsoft.com/kb/148652)
4545

46-
- "Global Overloaded Delete Operator Causes LNK2005" (Q140440)
46+
- [FIX: Global Overloaded Delete Operator Causes LNK2005](https://support.microsoft.com/kb/140440)
4747

48-
- "LNK2005 Errors on New and Delete When Defining _ATL_MIN_CRT" (Q184235).
48+
- [You receive LNK2005 errors when you compile an ATL executable (.exe) project in Visual C++](https://support.microsoft.com/kb/184235).
4949

50-
You can find Knowledge Base articles on the MSDN Library CD-ROM or at [http://support.microsoft.com/search](http://support.microsoft.com/search).
51-
52-
This error is followed by fatal error [LNK1169](../../error-messages/tool-errors/linker-tools-error-lnk1169.md).
50+
This error is followed by fatal error [LNK1169](../../error-messages/tool-errors/linker-tools-error-lnk1169.md).
5351

5452
### To fix by checking the following possible causes
5553

@@ -65,7 +63,7 @@ symbol already defined in object
6563

6664
- Declare the variable in .h: `extern BOOL MyBool;` and then assign to it in a .c or .cpp file: `BOOL MyBool = FALSE;`.
6765

68-
- Declare the variable [static](../../misc/static-cpp.md).
66+
- Declare the variable [static](../../cpp/storage-classes-cpp.md#static).
6967

7068
- Declare the variable [selectany](../../cpp/selectany.md).
7169

0 commit comments

Comments
 (0)