Skip to content

Commit 5685566

Browse files
authored
Merge pull request #5846 from TylerMSFT/linker
specify MAX_PATH limitation
2 parents b3c8c57 + 7bda6e1 commit 5685566

21 files changed

+177
-199
lines changed

docs/build/reference/base-base-address.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
22
description: "Learn more about: /BASE (Base address)"
33
title: "/BASE (Base address)"
4-
ms.date: 05/11/2022
4+
ms.date: 03/27/2025
55
f1_keywords: ["/base", "VC.Project.VCLinkerTool.BaseAddress"]
66
helpviewer_keywords: ["base addresses [C++]", "programs [C++], preventing relocation", "semicolon [C++], specifier", "-BASE linker option", "key address size", "environment variables [C++], LIB", "programs [C++], base address", "LIB environment variable", "BASE linker option", "DLLs [C++], linking", "/BASE linker option", "@ symbol for base address", "executable files [C++], base address", "at sign symbol for base address"]
7-
ms.assetid: 00b9f6fe-0bd2-4772-a69c-7365eb199069
87
---
98
# `/BASE` (Base address)
109

@@ -23,7 +22,7 @@ The **`/BASE`** linker option sets a base address for the program. It overrides
2322

2423
The linker issues an error if *`address`* isn't a multiple of 64K. You can optionally specify the size of the program. The linker issues a warning if the program can't fit in the size you specified.
2524

26-
On the command line, another way to specify the base address is by using a *base address response file*. A base address response file is a text file that contains the base addresses and optional sizes of all the DLLs your program uses, and a unique text key for each base address. To specify a base address by using a response file, use an at sign (**`@`**) followed by the name of the response file, *`filename`*, followed by a comma, then the *`key`* value for the base address to use in the file. The linker looks for *`filename`* in either the specified path, or if no path is specified, in the directories specified in the `LIB` environment variable. Each line in *`filename`* represents one DLL and has the following syntax:
25+
On the command line, another way to specify the base address is by using a *base address response file*. A base address response file is a text file that contains the base addresses and optional sizes of all the DLLs your program uses, and a unique text key for each base address. To specify a base address by using a response file, use an at sign (**`@`**) followed by the name of the response file, *`filename`*, followed by a comma, then the *`key`* value for the base address to use in the file. The linker looks for *`filename`* in either the specified path, or if no path is specified, in the directories specified in the `LIB` environment variable. The fully qualified *`filename`* must not exceed `MAX_PATH` (260 characters). Each line in *`filename`* represents one DLL and has the following syntax:
2726

2827
> *`key`* *`address`* \[*`size`*] **`;`** *`comment`*
2928
@@ -35,7 +34,7 @@ one 0x28000000 0x00100000 ; for DLLONE.DLL
3534
two 0x28100000 0x00300000 ; for DLLTWO.DLL
3635
```
3736

38-
If the file that contains these lines is called DLLS.txt, the following example command applies this information:
37+
If the file that contains these lines is called `DLLS.txt`, the following example command applies this information:
3938

4039
```cmd
4140
link dlltwo.obj /dll /base:@dlls.txt,two
@@ -46,9 +45,7 @@ Another way to set the base address is by using the *`BASE`* argument in a [`NAM
4645
### To set this linker option in the Visual Studio development environment
4746

4847
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).
49-
5048
1. Select the **Configuration Properties** > **Linker** > **Advanced** property page.
51-
5249
1. Modify the **Base Address** property.
5350

5451
### To set this linker option programmatically

docs/build/reference/def-specify-module-definition-file.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
22
description: "Learn more about: /DEF (Specify module-definition file)"
33
title: "/DEF (Specify module-definition file)"
4-
ms.date: 09/09/2022
4+
ms.date: 03/27/2025
55
f1_keywords: ["VC.Project.VCLinkerTool.ModuleDefinitionFile", "/def"]
66
helpviewer_keywords: ["module definition files, specifying", "DEF linker option", "-DEF linker option", "module definition files", "/DEF linker option"]
7-
ms.assetid: 6497fa68-65f0-48ca-8f66-b87166fc631a
87
---
98
# `/DEF` (Specify module-definition file)
109

@@ -17,7 +16,7 @@ Specifies a module-definition file to the linker.
1716
## Arguments
1817

1918
*`filename`*\
20-
The name of a module-definition file (*`.def`*) to be passed to the linker.
19+
The name of a module-definition file (*`.def`*) to be passed to the linker. When expanded, the fully qualified filename must not exceed `MAX_PATH` (260 characters).
2120

2221
## Remarks
2322

@@ -28,9 +27,7 @@ To specify a *`.def`* file from within the development environment, add it to th
2827
### To set this linker option in the Visual Studio development environment
2928

3029
1. Open the project's **Property Pages** dialog box. For more information, see [Set compiler and build properties](../working-with-project-properties.md).
31-
3230
1. Select the **Configuration Properties** > **Linker** > **Input** property page.
33-
3431
1. Modify the **Module Definition File** property. Choose **OK** or **Apply** to save your changes.
3532

3633
### To set this linker option programmatically

docs/build/reference/genprofile-fastgenprofile-generate-profiling-instrumented-build.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "/GENPROFILE, /FASTGENPROFILE (Generate Profiling Instrumented Build)"
33
description: "Learn more about: /GENPROFILE, /FASTGENPROFILE (Generate Profiling Instrumented Build)"
4-
ms.date: 04/14/2021
4+
ms.date: 03/27/2025
55
f1_keywords: ["GENPROFILE", "FASTGENPROFILE", "/GENPROFILE", "/FASTGENPROFILE"]
66
helpviewer_keywords: ["GENPROFILE", "FASTGENPROFILE"]
77
---
@@ -43,7 +43,7 @@ Use **`PATH`** to specify a separate set of PGO counters for each unique path t
4343
Specifies whether to use extra counters to keep an accurate count when exceptions are thrown during training. Use **`TRACKEH`** to specify extra counters for an exact count. Use **`NOTRACKEH`** to specify single counters for code that doesn't use exception handling or that doesn't run into exceptions in your training scenarios. When you specify **`/GENPROFILE`**, the default is **`TRACKEH`** . When you specify **`/FASTGENPROFILE`**, the default is **`NOTRACKEH`** .
4444

4545
**`PGD`**=*filename*\
46-
Specifies a base file name for the *`.pgd`* file. By default, the linker uses the base executable image file name with a *`.pgd`* extension.
46+
Specifies a base filename for the *`.pgd`* file. By default, the linker uses the base executable image filename with a *`.pgd`* extension. When expanded, the fully qualified filename must not exceed `MAX_PATH` (260 characters).
4747

4848
## Remarks
4949

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,45 @@
11
---
22
description: "Learn more about: /IDLOUT (Name MIDL Output Files)"
33
title: "/IDLOUT (Name MIDL Output Files)"
4-
ms.date: "11/04/2016"
4+
ms.date: 03/27/2025
55
f1_keywords: ["/idlout", "VC.Project.VCLinkerTool.MergedIDLBaseFileName"]
66
helpviewer_keywords: ["MIDL, output file names", ".idl files, path", "MIDL", "/IDLOUT linker option", "IDL files, path", "-IDLOUT linker option", "IDLOUT linker option"]
7-
ms.assetid: 10d00a6a-85b4-4de1-8732-e422c6931509
87
---
98
# /IDLOUT (Name MIDL Output Files)
109

11-
```
12-
/IDLOUT:[path\]filename
13-
```
10+
## Syntax
1411

15-
## Parameters
12+
> /IDLOUT:[path\]filename
1613
17-
*path*<br/>
18-
An absolute or relative path specification. By specifying a path, you affect only the location of an .idl file; all other files are placed in the project directory.
14+
## Argument
1915

20-
*filename*<br/>
21-
Specifies the name of the .idl file created by the MIDL compiler. No file extension is assumed; specify *filename*.idl if you want an .idl extension.
16+
*`path`*\
17+
An absolute or relative path specification. By specifying a path, you affect only the location of an `.idl` file; all other files are placed in the project directory.
18+
19+
*`filename`*\
20+
Specifies the name of the `.idl` file created by the MIDL compiler. No file extension is assumed; specify *`filename.idl` if you want an `.idl` extension. When expanded, the fully qualified filename must not exceed `MAX_PATH` (260 characters).
2221

2322
## Remarks
2423

25-
The /IDLOUT option specifies the name and extension of the .idl file.
24+
The `/IDLOUT` option specifies the name and extension of the `.idl `file.
2625

27-
The MIDL compiler is called by the MSVC linker when linking projects that have the [module](../../windows/attributes/module-cpp.md) attribute.
26+
The MIDL compiler is called by the MSVC linker when linking projects that have the [`module`](../../windows/attributes/module-cpp.md) attribute.
2827

29-
/IDLOUT also specifies the file names of the other output files associated with the MIDL compiler:
28+
`/IDLOUT` also specifies the file names of the other output files associated with the MIDL compiler:
3029

3130
- *filename*.tlb
32-
3331
- *filename*_p.c
34-
3532
- *filename*_i.c
36-
3733
- *filename*.h
3834

39-
*filename* is the parameter that you pass to /IDLOUT. If [/TLBOUT](tlbout-name-dot-tlb-file.md) is specified, the .tlb file will get its name from /TLBOUT *filename*.
35+
*`filename`* is the parameter that you pass to `/IDLOUT`. If [`/TLBOUT`](tlbout-name-dot-tlb-file.md) is specified, the .tlb file will get its name from `/TLBOUT` *`filename`*.
4036

41-
If you specify neither /IDLOUT nor /TLBOUT, the linker will create vc70.tlb, vc70.idl, vc70_p.c, vc70_i.c, and vc70.h.
37+
If you specify neither `/IDLOUT` nor `/TLBOUT`, the linker will create vc70.tlb, vc70.idl, vc70_p.c, vc70_i.c, and vc70.h.
4238

4339
### To set this linker option in the Visual Studio development environment
4440

4541
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).
46-
4742
1. Select the **Configuration Properties** > **Linker** > **Embedded IDL** property page.
48-
4943
1. Modify the **Merge IDL Base File Name** property.
5044

5145
### To set this linker option programmatically
@@ -54,8 +48,8 @@ If you specify neither /IDLOUT nor /TLBOUT, the linker will create vc70.tlb, vc7
5448

5549
## See also
5650

57-
[MSVC linker reference](linking.md)<br/>
58-
[MSVC Linker Options](linker-options.md)<br/>
59-
[/IGNOREIDL (Don't Process Attributes into MIDL)](ignoreidl-don-t-process-attributes-into-midl.md)<br/>
60-
[/MIDL (Specify MIDL Command Line Options)](midl-specify-midl-command-line-options.md)<br/>
51+
[MSVC linker reference](linking.md)\
52+
[MSVC Linker Options](linker-options.md)\
53+
[/IGNOREIDL (Don't Process Attributes into MIDL)](ignoreidl-don-t-process-attributes-into-midl.md)\
54+
[/MIDL (Specify MIDL Command Line Options)](midl-specify-midl-command-line-options.md)\
6155
[Building an Attributed Program](../../windows/attributes/cpp-attributes-com-net.md)

docs/build/reference/ilk-name-incremental-database-file.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "/ILK (Name incremental database file)"
33
description: "The MSVC linker option /ILK specifies the incremental link database file pathname."
4-
ms.date: 09/07/2022
4+
ms.date: 03/27/2025
55
f1_keywords: ["VC.Project.VCLinkerTool.IncrementalLinkDatabaseFile", "/ilk", "ilk"]
66
helpviewer_keywords: ["Name incremental database file in C++ linker", "/ILK linker option", "-ILK linker option", "ILK linker option"]
77
---
@@ -16,7 +16,7 @@ The **`/ILK`** linker option tells the linker where to put the *`.ilk`* database
1616
### Arguments
1717

1818
*`pathname`*\
19-
The destination directory and filename for the generated *`.ilk`* file. If the **`/ILK`** option isn't specified when **`/INCREMENTAL`** is used, the filename is created by appending *`.ilk`* to the target base filename.
19+
The destination directory and filename for the generated *`.ilk`* file. If the **`/ILK`** option isn't specified when **`/INCREMENTAL`** is used, the filename is created by appending *`.ilk`* to the target base filename. When expanded, the fully qualified filename must not exceed `MAX_PATH` (260 characters).
2020

2121
## Remarks
2222

@@ -25,9 +25,7 @@ The **`/ILK`** linker option tells the linker the path and filename to use for t
2525
### To set this compiler option in the Visual Studio development environment
2626

2727
1. Open the project **Property Pages** dialog box. For more information, see [Set compiler and build properties](../working-with-project-properties.md).
28-
2928
1. Select the **Configuration Properties** > **Linker** > **General** property page.
30-
3129
1. Modify the **Incremental Link Database File** property. The default value is `$(IntDir)$(TargetName).ilk`.
3230

3331
### To set this compiler option programmatically
Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,35 @@
11
---
22
description: "Learn more about: /IMPLIB (Name Import Library)"
33
title: "/IMPLIB (Name Import Library)"
4-
ms.date: "11/04/2016"
4+
ms.date: 03/24/2025
55
f1_keywords: ["/implib", "VC.Project.VCLinkerTool.ImportLIbrary"]
66
helpviewer_keywords: ["IMPLIB linker option", "/IMPLIB linker option", "-IMPLIB linker option", "import libraries, overriding default name"]
7-
ms.assetid: fe8f71ab-7055-41b5-8ef8-2b97cfa4a432
87
---
9-
# /IMPLIB (Name Import Library)
8+
# `/IMPLIB` (Name Import Library)
9+
10+
## Syntax
1011

1112
> /IMPLIB:*filename*
1213
13-
## Parameters
14+
## Argument
1415

15-
*filename*<br/>
16-
A user-specified name for the import library. It replaces the default name.
16+
*`filename`*\
17+
A user-specified name for the import library. It replaces the default name. When expanded, the fully qualified filename must not exceed `MAX_PATH` (260 characters).
1718

1819
## Remarks
1920

20-
The /IMPLIB option overrides the default name for the import library that LINK creates when it builds a program that contains exports. The default name is formed from the base name of the main output file and the extension .lib. A program contains exports if one or more of the following are specified:
21+
The `/IMPLIB` option overrides the default name for the import library that LINK creates when it builds a program that contains exports. The default name is formed from the base name of the main output file and the extension `.lib`. A program contains exports if one or more of the following are specified:
2122

2223
- The [__declspec(dllexport)](../../cpp/dllexport-dllimport.md) keyword in the source code
23-
2424
- [EXPORTS](exports.md) statement in a .def file
25-
2625
- An [/EXPORT](export-exports-a-function.md) specification in a LINK command
2726

28-
LINK ignores /IMPLIB when an import library is not being created. If no exports are specified, LINK does not create an import library. If an export file is used in the build, LINK assumes that an import library already exists and does not create one. For information on import libraries and export files, see [LIB Reference](lib-reference.md).
27+
LINK ignores `/IMPLIB` when an import library isn't being created. If no exports are specified, LINK doesn't create an import library. If an export file is used in the build, LINK assumes that an import library already exists and doesn't create one. For information on import libraries and export files, see [LIB Reference](lib-reference.md).
2928

3029
### To set this linker option in the Visual Studio development environment
3130

3231
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).
33-
3432
1. Select the **Configuration Properties** > **Linker** > **Advanced** property page.
35-
3633
1. Modify the **Import Library** property.
3734

3835
### To set this linker option programmatically
@@ -41,5 +38,5 @@ LINK ignores /IMPLIB when an import library is not being created. If no exports
4138

4239
## See also
4340

44-
[MSVC linker reference](linking.md)<br/>
41+
[MSVC linker reference](linking.md)\
4542
[MSVC Linker Options](linker-options.md)

0 commit comments

Comments
 (0)