Skip to content

Commit 6012887

Browse files
authored
Merge pull request #853 from MicrosoftDocs/master
5/30 AM Publish
2 parents ddec42d + 4e3dfd9 commit 6012887

13 files changed

+214
-120
lines changed
Lines changed: 37 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
title: "-DEFAULTLIB (Specify Default Library) | Microsoft Docs"
2+
title: "/DEFAULTLIB (Specify Default Library) | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "11/04/2016"
4+
ms.date: "05/29/2018"
55
ms.technology: ["cpp-tools"]
66
ms.topic: "reference"
77
f1_keywords: ["VC.Project.VCLinkerTool.DefaultLibraries", "/defaultlib"]
@@ -13,29 +13,38 @@ ms.author: "corob"
1313
ms.workload: ["cplusplus"]
1414
---
1515
# /DEFAULTLIB (Specify Default Library)
16-
```
17-
/DEFAULTLIB:library
18-
```
19-
20-
## Remarks
21-
where:
22-
23-
*library*
24-
The name of a library to search when resolving external references.
25-
26-
## Remarks
27-
The /DEFAULTLIB option adds one *library* to the list of libraries that LINK searches when resolving references. A library specified with /DEFAULTLIB is searched after libraries specified on the command line and before default libraries named in .obj files.
28-
29-
The [Ignore All Default Libraries](../../build/reference/nodefaultlib-ignore-libraries.md) (/NODEFAULTLIB) option overrides /DEFAULTLIB:*library*. The [Ignore Libraries](../../build/reference/nodefaultlib-ignore-libraries.md) (/NODEFAULTLIB:*library*) option overrides /DEFAULTLIB:*library* when the same *library* name is specified in both.
30-
31-
### To set this linker option in the Visual Studio development environment
32-
33-
- This linker option is not available from the Visual Studio development environment. To add a library to the link phase, use the **Additional Dependencies** property from the **Input** property page.
34-
35-
### To set this linker option programmatically
36-
37-
- See <xref:Microsoft.VisualStudio.VCProjectEngine.VCLinkerTool.AdditionalOptions%2A>.
38-
39-
## See Also
40-
[Setting Linker Options](../../build/reference/setting-linker-options.md)
41-
[Linker Options](../../build/reference/linker-options.md)
16+
17+
Specify a default library to search to resolve external references.
18+
19+
## Syntax
20+
21+
> **/DEFAULTLIB**:_library_
22+
23+
### Arguments
24+
25+
|Argument|Description|
26+
|-|-|
27+
*library*|The name of a library to search when resolving external references.
28+
29+
## Remarks
30+
31+
The **/DEFAULTLIB** option adds one *library* to the list of libraries that LINK searches when resolving references. A library specified with **/DEFAULTLIB** is searched after libraries specified explicitly on the command line and before default libraries named in .obj files.
32+
33+
When used without arguments, the [/NODEFAULTLIB (Ignore All Default Libraries)](../../build/reference/nodefaultlib-ignore-libraries.md) option overrides all **/DEFAULTLIB**:*library* options. The **/NODEFAULTLIB**:*library* option overrides **/DEFAULTLIB**:*library* when the same *library* name is specified in both.
34+
35+
### To set this linker option in the Visual Studio development environment
36+
37+
1. Open the project **Property Pages** dialog box. For more information, see [Working with Project Properties](../../ide/working-with-project-properties.md).
38+
39+
1. Select the **Configuration Properties** > **Linker** > **Command Line** property page.
40+
41+
1. In **Additional Options**, enter a **/DEFAULTLIB**:*library* option for each library to search. Choose **OK** to save your changes.
42+
43+
### To set this linker option programmatically
44+
45+
- See <xref:Microsoft.VisualStudio.VCProjectEngine.VCLinkerTool.AdditionalOptions%2A>.
46+
47+
## See also
48+
49+
- [Setting Linker Options](../../build/reference/setting-linker-options.md)
50+
- [Linker Options](../../build/reference/linker-options.md)

docs/c-runtime-library/reference/get-osfhandle.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "_get_osfhandle | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "12/12/2017"
4+
ms.date: "05/29/2018"
55
ms.technology: ["cpp-standard-libraries"]
66
ms.topic: "reference"
77
apiname: ["_get_osfhandle"]
@@ -34,7 +34,7 @@ An existing file descriptor.
3434

3535
## Return Value
3636

37-
Returns an operating-system file handle if *fd* is valid. Otherwise, the invalid parameter handler is invoked, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md). If execution is allowed to continue, this function returns **INVALID_HANDLE_VALUE** (-1) and sets **errno** to **EBADF**, indicating an invalid file handle.
37+
Returns an operating-system file handle if *fd* is valid. Otherwise, the invalid parameter handler is invoked, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md). If execution is allowed to continue, this function returns **INVALID_HANDLE_VALUE** (-1) and sets **errno** to **EBADF**, indicating an invalid file handle. To avoid a compiler warning when the result is used in routines that expect a Win32 file handle, cast it to a **HANDLE** type.
3838

3939
## Remarks
4040

docs/c-runtime-library/reference/open-osfhandle.md

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "_open_osfhandle | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "12/12/2017"
4+
ms.date: "05/29/2018"
55
ms.technology: ["cpp-standard-libraries"]
66
ms.topic: "reference"
77
apiname: ["_open_osfhandle"]
@@ -42,23 +42,18 @@ If successful, **_open_osfhandle** returns a C run-time file descriptor. Otherwi
4242

4343
## Remarks
4444

45-
The **_open_osfhandle** function allocates a C run-time file descriptor and associates it with the operating-system file handle specified by *osfhandle*. The *flags* argument is an integer expression formed from one or more of the manifest constants defined in Fcntl.h. When two or more manifest constants are used to form the *flags* argument, the constants are combined with the bitwise-OR operator ( **&#124;** ).
45+
The **_open_osfhandle** function allocates a C run-time file descriptor and associates it with the operating-system file handle specified by *osfhandle*. To avoid a compiler warning, cast the *osfhandle* argument from **HANDLE** to **intptr_t**. The *flags* argument is an integer expression formed from one or more of the manifest constants defined in \<fcntl.h>. When two or more manifest constants are used to form the *flags* argument, the constants are combined with the bitwise-OR operator ( **&#124;** ).
4646

47-
Fcntl.h defines the following manifest constants:
47+
These manifest constants are defined in \<fcntl.h>:
4848

49-
**\_O\_APPEND**
50-
Positions a file pointer to the end of the file before every write operation.
49+
|||
50+
|-|-|
51+
**\_O\_APPEND**|Positions a file pointer to the end of the file before every write operation.
52+
**\_O\_RDONLY**|Opens the file for reading only.
53+
**\_O\_TEXT**|Opens the file in text (translated) mode.
54+
**\_O\_WTEXT**|Opens the file in Unicode (translated UTF-16) mode.
5155

52-
**\_O\_RDONLY**
53-
Opens the file for reading only.
54-
55-
**\_O\_TEXT**
56-
Opens the file in text (translated) mode.
57-
58-
**\_O\_WTEXT**
59-
Opens the file in Unicode (translated UTF-16) mode.
60-
61-
To close a file opened with **_open_osfhandle**, call [\_close](close.md). The underlying OS file handle is also closed by a call to **_close**, so it is not necessary to call the Win32 function **CloseHandle** on the original handle. If the file descriptor is owned by a **FILE &#42;** stream, then calling [fclose](fclose-fcloseall.md) on that **FILE &#42;** stream also closes both the file descriptor and the underlying handle. In this case, do not call **_close** on the file descriptor.
56+
The **_open_osfhandle** call transfers ownership of the Win32 file handle to the file descriptor. To close a file opened with **_open_osfhandle**, call [\_close](close.md). The underlying OS file handle is also closed by a call to **_close**, so it is not necessary to call the Win32 function **CloseHandle** on the original handle. If the file descriptor is owned by a **FILE &#42;** stream, then calling [fclose](fclose-fcloseall.md) on that **FILE &#42;** stream also closes both the file descriptor and the underlying handle. In this case, do not call **_close** on the file descriptor.
6257

6358
## Requirements
6459

docs/cpp/errors-and-exception-handling-modern-cpp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class MyClass
3838
public:
3939
void MyFunc(char c)
4040
{
41-
if(c < numeric_limits<char>::max())
41+
if(c > numeric_limits<char>::max())
4242
throw invalid_argument("MyFunc argument too large.");
4343
//...
4444
}

docs/error-messages/compiler-errors-1/fatal-error-c1083.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ When a project is configured to use precompiled headers, the relevant .pch files
9696

9797
- The file is compiled by using a different **/analyze** compiler option setting than is used to precompile the headers. When the headers for a project are precompiled, all should use the same **/analyze** settings. For more information, see [/analyze (Code Analysis)](../../build/reference/analyze-code-analysis.md).
9898

99+
- The file or directory was created by the Windows Subsystem for Linux, per-directory case sensitivity is enabled, and the specified case of a path or file does not match the case of the path or file on disk.
100+
99101
- The file, the directory, or the disk is read-only.
100102

101103
- Visual Studio or the command line tools do not have sufficient permissions to read the file or the directory. This can happen, for example, when the project files have different ownership than the process running Visual Studio or the command line tools. Sometimes this issue can be fixed by running Visual Studio or the developer command prompt as Administrator.
@@ -117,4 +119,4 @@ For information about how to build C/C++ projects in the IDE or on the command l
117119

118120
## See also
119121

120-
[MSBuild Properties](/visualstudio/msbuild/msbuild-properties)
122+
- [MSBuild Properties](/visualstudio/msbuild/msbuild-properties)

docs/error-messages/tool-errors/TOC.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@
155155
## [Linker Tools Error LNK1312](linker-tools-error-lnk1312.md)
156156
## [Linker Tools Error LNK1313](linker-tools-error-lnk1313.md)
157157
## [Linker Tools Error LNK1314](linker-tools-error-lnk1314.md)
158+
## [Linker Tools Error LNK1318](linker-tools-error-lnk1318.md)
158159
## [Linker Tools Error LNK1332](linker-tools-error-lnk1332.md)
159160
## [Linker Tools Error LNK1561](linker-tools-error-lnk1561.md)
160161
## [Linker Tools Error LNK2001](linker-tools-error-lnk2001.md)
@@ -185,6 +186,7 @@
185186
## [Linker Tools Warning LNK4006](linker-tools-warning-lnk4006.md)
186187
## [Linker Tools Warning LNK4010](linker-tools-warning-lnk4010.md)
187188
## [Linker Tools Warning LNK4014](linker-tools-warning-lnk4014.md)
189+
## [Linker Tools Warning LNK4020](linker-tools-warning-lnk4020.md)
188190
## [Linker Tools Warning LNK4022](linker-tools-warning-lnk4022.md)
189191
## [Linker Tools Warning LNK4037](linker-tools-warning-lnk4037.md)
190192
## [Linker Tools Warning LNK4039](linker-tools-warning-lnk4039.md)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
title: "Linker Tools Error LNK1318 | Microsoft Docs"
3+
ms.custom: ""
4+
ms.date: "05/29/2018"
5+
ms.technology: ["cpp-diagnostics"]
6+
ms.topic: "error-reference"
7+
f1_keywords: ["LNK1318"]
8+
dev_langs: ["C++"]
9+
helpviewer_keywords: ["LNK1318"]
10+
author: "corob-msft"
11+
ms.author: "corob"
12+
ms.workload: ["cplusplus"]
13+
---
14+
# Linker Tools Error LNK1318
15+
16+
> Unexpected PDB error; *cause* '*details*'
17+
18+
The linker encountered an unexpected error when opening, reading, or writing to a PDB file.
19+
20+
This error message is produced for uncommon issues in PDB files. The *cause* and *details* represent the information available to the linker when the failure occurred. This may not be very useful, as common errors when dealing with PDB files have separate, more informative error messages.
21+
22+
Because the source of the error is uncommon, there is only generic advice available for resolving this issue:
23+
24+
- Perform a clean operation in your build directories, and then do a full build of your solution.
25+
26+
- Reboot your computer, or check for stray or hung mspdbsrv.exe processes and kill them in TaskManager.
27+
28+
- Turn off antivirus checks in your project directories.
29+
30+
- Use the [/Zf](../../build/reference/zf.md) compiler option if using [/MP](../../build/reference/mp-build-with-multiple-processes.md) with MSBuild or another parallel build process.
31+
32+
- Try building by using the 64-bit hosted toolset.
33+
34+
- Serialize linking to mitigate parallel link issues if needed. This error can be caused if mspdbsrv.exe is launched by one instance of link, and is shut down before another instance of link is done using it. The downside to this fix is that your project builds may take considerably longer to complete.

docs/error-messages/tool-errors/linker-tools-errors-and-warnings.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ LINK, LIB, DUMPBIN, and EDITBIN generate these errors and warnings.
121121

122122
[Linker Tools Error LNK1314](../../error-messages/tool-errors/linker-tools-error-lnk1314.md)
123123

124+
[Linker Tools Error LNK1318](../../error-messages/tool-errors/linker-tools-error-lnk1318.md)
125+
124126
[Linker Tools Error LNK1332](../../error-messages/tool-errors/linker-tools-error-lnk1332.md)
125127

126128
[Linker Tools Error LNK1561](../../error-messages/tool-errors/linker-tools-error-lnk1561.md)
@@ -171,6 +173,8 @@ LINK, LIB, DUMPBIN, and EDITBIN generate these errors and warnings.
171173

172174
[Linker Tools Warning LNK4014](../../error-messages/tool-errors/linker-tools-warning-lnk4014.md)
173175

176+
[Linker Tools Warning LNK4020](../../error-messages/tool-errors/linker-tools-warning-lnk4020.md)
177+
174178
[Linker Tools Warning LNK4022](../../error-messages/tool-errors/linker-tools-warning-lnk4022.md)
175179

176180
[Linker Tools Warning LNK4039](../../error-messages/tool-errors/linker-tools-warning-lnk4039.md)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
title: "Linker Tools Warning LNK4020 | Microsoft Docs"
3+
ms.custom: ""
4+
ms.date: "05/29/2018"
5+
ms.technology: ["cpp-diagnostics"]
6+
ms.topic: "error-reference"
7+
f1_keywords: ["LNK4020"]
8+
dev_langs: ["C++"]
9+
helpviewer_keywords: ["LNK4020"]
10+
author: "corob-msft"
11+
ms.author: "corob"
12+
ms.workload: ["cplusplus"]
13+
---
14+
# Linker Tools Warning LNK4020
15+
16+
> a type record in '*filename*' is corrupted; some symbols and types may not be accessible from the debugger
17+
18+
The PDB file *filename* has a corrupted type record.
19+
20+
This issue is often secondary to other build issues; unless this is the first reported build issue, deal with the other errors and warnings first. If this is the first reported issue, you may need to clean your build directories and rebuild your project. If you use parallel build processes, see if the error persists when you serialize your build.

0 commit comments

Comments
 (0)