You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LINK.exe links Common Object File Format (COFF) object files and libraries to create an executable (.exe) file or a dynamic-link library (DLL).
11
12
@@ -23,6 +24,8 @@ On the command line, linker options are not case-sensitive; for example, /base a
23
24
24
25
You can use the [comment](../../preprocessor/comment-c-cpp.md) pragma to specify some linker options.
25
26
27
+
## Linker options listed alphabetically
28
+
26
29
|Option|Purpose|
27
30
|------------|-------------|
28
31
|[@](at-specify-a-linker-response-file.md)|Specifies a response file.|
@@ -73,6 +76,8 @@ You can use the [comment](../../preprocessor/comment-c-cpp.md) pragma to specify
73
76
|[/KEYFILE](keyfile-specify-key-or-key-pair-to-sign-an-assembly.md)|Specifies a key or key pair to sign an assembly.|
74
77
|[/LARGEADDRESSAWARE](largeaddressaware-handle-large-addresses.md)|Tells the compiler that the application supports addresses larger than two gigabytes|
75
78
|[/LIBPATH](libpath-additional-libpath.md)|Specifies a path to search before the environmental library path.|
79
+
|[/LINKREPRO](linkrepro.md)|Specifies a path to generate link repro artifacts in.|
80
+
|[/LINKREPROTARGET](linkreprotarget.md)|Specifies a file name to use for generated link repro artifacts.|
Copy file name to clipboardExpand all lines: docs/overview/how-to-report-a-problem-with-the-visual-cpp-toolset.md
+17-10Lines changed: 17 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
---
2
2
title: "How to report a problem with the Microsoft C++ toolset"
3
-
ms.date: "06/21/2019"
3
+
description: How to create a good problem report and repro information for the Microsoft C++ toolset.
4
+
ms.date: "09/24/2019"
4
5
ms.technology: "cpp-ide"
5
6
author: "corob-msft"
6
7
ms.author: "corob"
@@ -311,19 +312,19 @@ Finally, attach the preprocessed repro files (*filename*.i and *modulename*.i) a
311
312
312
313
### Link repros
313
314
314
-
A *Link repro* is the linker-generated contents of a directory specified by the **link\_repro** environment variable. It contains build artifacts that collectively demonstrate a problem that occurs at link time. Examples include a backend crash involving Link-Time Code Generation (LTCG), or a linker crash. These build artifacts are the ones needed as linker input so that the problem can be reproduced. A Link repro can be created easily by using this environment variable. It enables the linker's built-in repro generation capability.
315
+
A *link repro* is the linker-generated contents of a directory specified either by the **link\_repro** environment variable, or as an argument to the [/LINKREPRO](../build/reference/linkrepro.md) linker option. It contains build artifacts that collectively demonstrate a problem that occurs at link time. Examples include a backend crash involving Link-Time Code Generation (LTCG), or a linker crash. These build artifacts are the ones needed as linker input so the problem can be reproduced. A link repro can be created easily by using this environment variable. It enables the linker's built-in repro generation capability.
315
316
316
-
#### To generate a Link repro using the link_repro environment variable
317
+
#### To generate a link repro using the link_repro environment variable
317
318
318
319
1. Capture the command-line arguments used to build your repro, as described in [To report the contents of the command line](#to-report-the-contents-of-the-command-line).
319
320
320
321
1. Open the **Developer Command Prompt** that matches the Visual Studio version and configuration architecture used to build your project.
321
322
322
323
1. In the developer command prompt console window, change to the directory that contains your repro project.
323
324
324
-
1. Enter **mkdir linkrepro** to create a directory for the Link repro.
325
+
1. Enter **mkdir linkrepro** to create a directory named *linkrepro*for the link repro. You can use a different name to capture another link repro.
325
326
326
-
1. Enter the command **set link\_repro=linkrepro** to set the **link\_repro** environment variable to the directory you created. If your build is run from a different directory, as is often the case for more complex projects, then set **link\_repro** to the full path to your linkrepro directory instead.
327
+
1. Enter the command **set link\_repro=linkrepro** to set the **link\_repro** environment variable to the directory you created. If your build is run from a different directory, as is often the case for more complex projects, then set **link\_repro** to the full path to your link repro directory instead.
327
328
328
329
1. To build the repro project in Visual Studio, in the developer command prompt console window, enter the command **devenv**. It ensures that the value of the **link\_repro** environment variable is visible to Visual Studio. To build the project at the command line, use the command-line arguments captured above to duplicate the repro build.
329
330
@@ -333,17 +334,23 @@ A *Link repro* is the linker-generated contents of a directory specified by the
333
334
334
335
1. In the developer command prompt console window, enter the command **set link\_repro=** to clear the **link\_repro** environment variable.
335
336
336
-
#### To generate a Link repro using the /LINKREPRO linker option
337
+
Finally, package the repro by compressing the entire linkrepro directory into a .zip file or similar, and attach it to your report.
337
338
338
-
The /LINKREPRO linker option has the same effect as the **link\_repro** environment variable. You can also use the /LINKREPROTARGET option to specify the name to use for the generated link repro. To use /LINKREPROTARGET, you must specify the /OUT option.
339
+
The **/LINKREPRO** linker option has the same effect as the **link\_repro** environment variable. You can use the [/LINKREPROTARGET](../build/reference/linkreprotarget.md) option to specify the name to use for the generated link repro. To use **/LINKREPROTARGET**, you must also specify the **/OUT** linker option.
339
340
340
-
<!-- TODO TODO -->
341
+
#### To generate a link repro using the /LINKREPRO option
341
342
342
-
Finally, package the repro by compressing the entire linkrepro directory into a .zip file or similar and attach it to your report.
343
+
1. Create a directory to hold the link repro. We'll refer to the full directory path you create as _directory-path_. Use double quotes around the path if it includes spaces.
344
+
345
+
1. Add the **/LINKREPRO:**_directory-path_ command to the linker command line. In Visual Studio, open the **Property Pages** dialog for your project. Select the **Configuration Properties** > **Linker** > **Command Line** property page. Then, enter the **/LINKREPRO:**_directory-path_ option in the **Additional Options** box. Choose **OK** to save your changes.
346
+
347
+
1. Build your repro project, and confirm that the expected problem has occurred.
348
+
349
+
Finally, package the repro by compressing the entire _directory-path_ link repro directory into a .zip file or similar, and attach it to your report.
343
350
344
351
### Other repros
345
352
346
-
If you can't reduce the problem to a single source file or preprocessed repro, and the problem doesn't require a Link repro, we can investigate an IDE project. All the guidance on how to create a good repro still applies: The code ought to be minimal and self-contained. The problem should occur in our most recent tools, and if relevant, shouldn't be seen in other compilers.
353
+
If you can't reduce the problem to a single source file or preprocessed repro, and the problem doesn't require a link repro, we can investigate an IDE project. All the guidance on how to create a good repro still applies: The code ought to be minimal and self-contained. The problem should occur in our most recent tools, and if relevant, shouldn't be seen in other compilers.
347
354
348
355
Create your repro as a minimal IDE project, then package it by compressing the entire directory structure into a .zip file or similar and attach it to your report.
0 commit comments