Skip to content

Commit cefa83c

Browse files
authored
Merge pull request MicrosoftDocs#846 from corob-msft/cr-issue-257
Update /DEFAULTLIB per issue 257
2 parents 4837f58 + 6546ff4 commit cefa83c

File tree

1 file changed

+37
-28
lines changed

1 file changed

+37
-28
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)

0 commit comments

Comments
 (0)