/SOURCELINK (Include Source Link file in PDB)

Specifies a Source Link configuration file to include in the PDB file generated by the linker.




Specifies a JSON-formatted configuration file that contains a simple mapping of local file paths to URLs where the source file can be retrieved for display by the debugger. For more information on the format of this file, see Source Link JSON Schema.


Source Link is a language- and source-control agnostic system for providing source debugging for binaries. Source Link is supported for native C++ binaries starting in Visual Studio 2017 version 15.8. For an overview of Source Link, see Source Link. For information on how to use Source Link in your projects and how to generate the SourceLink file as part of your project, see Using Source Link.

  1. Open the Property Pages dialog box for the project. 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 the Additional options box, add /SOURCELINK:filename and then choose OK or Apply to save your changes.

To set this linker option programmatically

  • This option does not have a programmatic equivalent.

See also

MSVC linker reference
MSVC Linker Options