Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
43 lines (26 sloc) 1.84 KB
title f1_keywords helpviewer_keywords ms.assetid
/DEFAULTLIB (Specify Default Library)
-DEFAULTLIB linker option
DEFAULTLIB linker option
/DEFAULTLIB linker option
libraries, adding to list of

/DEFAULTLIB (Specify Default Library)

Specify a default library to search to resolve external references.




The name of a library to search when resolving external references.


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.

When used without arguments, the /NODEFAULTLIB (Ignore All Default Libraries) option overrides all /DEFAULTLIB:library options. The /NODEFAULTLIB:library option overrides /DEFAULTLIB:library when the same library name is specified in both.

To set this linker option in the Visual Studio development environment

  1. Open the project Property Pages dialog box. For more information, see Set C++ compiler and build properties in Visual Studio.

  2. Select the Configuration Properties > Linker > Command Line property page.

  3. In Additional Options, enter a /DEFAULTLIB:library option for each library to search. Choose OK to save your changes.

To set this linker option programmatically

  • See xref:Microsoft.VisualStudio.VCProjectEngine.VCLinkerTool.AdditionalOptions%2A.

See also

You can’t perform that action at this time.