|
| 1 | +--- |
| 2 | +title: "/LINKREPRO (Link repro directory name)" |
| 3 | +description: Linker option to set the directory for a link repro file. |
| 4 | +ms.date: "09/24/2019" |
| 5 | +f1_keywords: ["/LINKREPRO"] |
| 6 | +helpviewer_keywords: ["LINKREPRO linker option", "/LINKREPRO linker option", "-LINKREPRO linker option", "linker repro reporting"] |
| 7 | +--- |
| 8 | +# /LINKREPRO (Link repro directory name) |
| 9 | + |
| 10 | +Tells the linker to generate a link repro in a specified directory. |
| 11 | + |
| 12 | +## Syntax |
| 13 | + |
| 14 | +> **/LINKREPRO:**_directory-name_ |
| 15 | +
|
| 16 | +### Arguments |
| 17 | + |
| 18 | +**/LINKREPRO:**_directory-name_\ |
| 19 | +The user-specified directory to store the link repro in. Directory names that include spaces must be enclosed in double quotes. |
| 20 | + |
| 21 | +## Remarks |
| 22 | + |
| 23 | +The **/LINKREPRO** linker option is used to create a *link repro*. It's a set of build artifacts that allow Microsoft to reproduce a problem that occurs at link time. It's useful for problems such as a backend crash involving Link-Time Code Generation (LTCG), an LNK1000 linker error, or a linker crash. The linker produces a link repro when you specify the **/LINKREPRO** linker option, or when you set the `link_repro` environment variable in your command-line build environment. |
| 24 | + |
| 25 | +Create a link repro to get support for an LTCG crash, a linker crash, or an internal error that happens at link time. For more information, see the [Link repros](../../overview/how-to-report-a-problem-with-the-visual-cpp-toolset.md#link-repros) section of [How to report a problem with the Microsoft C++ toolset](../../overview/how-to-report-a-problem-with-the-visual-cpp-toolset.md). |
| 26 | + |
| 27 | +Both the **/LINKREPRO** linker option and the `link_repro` environment variable require you to specify an output directory for the link repro. On the command line or in the IDE, specify the directory by using a **/LINKREPRO:**_directory-name_ option. The _directory-name_ you specify may be an absolute or relative path, but the directory must exist. The command-line option overrides any directory value set in the `link_repro` environment variable. You must also specify the [/OUT](out-output-file-name.md) linker option when you use the **/LINKREPRO** option. |
| 28 | + |
| 29 | +For information on how to set a link repro file name, see the [/LINKREPROTARGET](linkreprotarget.md) linker option. This option can be used to specify different names for different link repros. It's useful in complex builds that invoke the linker more than once. |
| 30 | + |
| 31 | +### To set this linker option in the Visual Studio development environment |
| 32 | + |
| 33 | +1. Open the project's **Property Pages** dialog box. For details, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md). |
| 34 | + |
| 35 | +1. Select the **Configuration Properties** > **Linker** > **Command Line** property page. |
| 36 | + |
| 37 | +1. Enter the **/LINKREPRO:**_directory-name_ option in the **Additional Options** box. The _directory-name_ value you specify must exist. Choose **OK** to apply the change. |
| 38 | + |
| 39 | +### To set this linker option programmatically |
| 40 | + |
| 41 | +- See <xref:Microsoft.VisualStudio.VCProjectEngine.VCLinkerTool.AdditionalOptions%2A>. |
| 42 | + |
| 43 | +## See also |
| 44 | + |
| 45 | +[MSVC linker reference](linking.md)\ |
| 46 | +[MSVC Linker Options](linker-options.md)\ |
| 47 | +[/LINKREPROTARGET](linkreprotarget.md) |
0 commit comments