Skip to content

Commit 5587245

Browse files
committed
specify MAX_PATH limitation
1 parent e33672e commit 5587245

13 files changed

+60
-73
lines changed

docs/build/reference/base-base-address.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: /BASE (Base address)"
33
title: "/BASE (Base address)"
4-
ms.date: 05/11/2022
4+
ms.date: 03/24/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 *`filename`* can't contain more than `MAX_PATH` (260) characters. Each line in *`filename`* represents one DLL and has the following syntax:
2726

2827
> *`key`* *`address`* \[*`size`*] **`;`** *`comment`*
2928
@@ -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/idlout-name-midl-output-files.md

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,37 @@ title: "/IDLOUT (Name MIDL Output Files)"
44
ms.date: "11/04/2016"
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-
```
10+
```cmd
1211
/IDLOUT:[path\]filename
1312
```
1413

1514
## Parameters
1615

17-
*path*<br/>
16+
*`path`*\
1817
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.
1918

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.
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. The path and 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

@@ -54,8 +50,8 @@ If you specify neither /IDLOUT nor /TLBOUT, the linker will create vc70.tlb, vc7
5450

5551
## See also
5652

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/>
53+
[MSVC linker reference](linking.md)\
54+
[MSVC Linker Options](linker-options.md)\
55+
[/IGNOREIDL (Don't Process Attributes into MIDL)](ignoreidl-don-t-process-attributes-into-midl.md)\
56+
[/MIDL (Specify MIDL Command Line Options)](midl-specify-midl-command-line-options.md)\
6157
[Building an Attributed Program](../../windows/attributes/cpp-attributes-com-net.md)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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. The *`pathname`* must not exceed `MAX_PATH` (260) characters.
2020

2121
## Remarks
2222

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
---
22
description: "Learn more about: /LIBPATH (Additional Libpath)"
33
title: "/LIBPATH (Additional Libpath)"
4-
ms.date: "11/04/2016"
4+
ms.date: 03/24/2025
55
f1_keywords: ["/libpath", "VC.Project.VCLinkerTool.AdditionalLibraryDirectories"]
66
helpviewer_keywords: ["LIBPATH linker option", "/LIBPATH linker option", "Additional Libpath linker option", "environment library path override", "-LIBPATH linker option", "library path linker option"]
7-
ms.assetid: 7240af0b-9a3d-4d53-8169-2a92cd6958ba
87
---
9-
# /LIBPATH (Additional Libpath)
8+
# `/LIBPATH` (Additional Libpath)
109

11-
```
10+
```cmd
1211
/LIBPATH:dir
1312
```
1413

1514
## Parameters
1615

17-
*dir*<br/>
18-
Specifies a path that the linker will search before it searches the path specified in the LIB environment option.
16+
*`dir`*\
17+
Specifies a path that the linker will search before it searches the path specified in the LIB environment option. Must not exceed `MAX_PATH` (260) characters.
1918

2019
## Remarks
2120

22-
Use the /LIBPATH option to override the environment library path. The linker will first search in the path specified by this option, and then search in the path specified in the LIB environment variable. You can specify only one directory for each /LIBPATH option you enter. If you want to specify more than one directory, you must specify multiple /LIBPATH options. The linker will then search the specified directories in order.
21+
Use the `/LIBPATH` option to override the environment library path. The linker will first search in the path specified by this option, and then search in the path specified in the LIB environment variable. You can specify only one directory for each `/LIBPATH` option you enter. If you want to specify more than one directory, you must specify multiple `/LIBPATH` options. The linker will then search the specified directories in order.
2322

2423
### To set this linker option in the Visual Studio development environment
2524

@@ -35,5 +34,5 @@ Use the /LIBPATH option to override the environment library path. The linker wil
3534

3635
## See also
3736

38-
[MSVC linker reference](linking.md)<br/>
37+
[MSVC linker reference](linking.md)\
3938
[MSVC Linker Options](linker-options.md)

docs/build/reference/link-repro-full-path-rsp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ This flag was introduced in Visual Studio 2022 version 17.11.
1717
1818
## Remarks
1919

20-
Rather than generating a full link repro like `/LINKREPRO` which copies all the files to a directory and creating a response file with relative paths to that directory, this option writes the names of the files used during linking to the specified file.
20+
The *`filename`* argument specifies the name of the response file to create. The linker will write the fully qualified paths of all input files to this file. The file will be created in the current working directory unless a full path is specified. The *`filename`* must not exceed `MAX_PATH` (260) characters.
2121

2222
For example, given:
2323
- a directory `c:\temp\test` that contains the files `test.cpp`, `f1.cpp`, `f2.cpp`

docs/build/reference/linking.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: "Learn more about: Linking"
33
title: "MSVC linker reference"
4-
ms.date: "12/10/2018"
4+
ms.date: 03/24/2025
55
---
66
# Linking
77

@@ -36,7 +36,7 @@ The `arguments` include options and filenames and can be specified in any order.
3636

3737
On the command line, an option consists of an option specifier, either a dash (`-`) or a forward slash (`/`), followed by the name of the option. Option names can't be abbreviated. Some options take an argument, specified after a colon (`:`). No spaces or tabs are allowed within an option specification, except within a quoted string in the `/COMMENT` option. Specify numeric arguments in decimal or C-language notation. Option names and their keyword or filename arguments aren't case sensitive, but identifiers as arguments are case sensitive.
3838

39-
To pass a file to the linker, specify the filename on the command line after the `link.exe` command. You can specify an absolute or relative path with the filename, and you can use wildcards in the filename. If you omit the dot (`.`) and filename extension, the linker assumes an extension of `.obj` to find the file. The linker doesn't use filename extensions or the lack of them to make assumptions about the contents of files. It determines the type of file by examining it, and processes it accordingly.
39+
To pass a file to the linker, specify the filename on the command line after the `link.exe` command. You can specify an absolute or relative path with the filename, and you can use wildcards in the filename. The filename must not contain more than `MAX_PATH` (260) characters. If you omit the dot (`.`) and filename extension, the linker assumes an extension of `.obj` to find the file. The linker doesn't use filename extensions or the lack of them to make assumptions about the contents of files. It determines the type of file by examining it, and processes it accordingly.
4040

4141
The linker returns zero for success (no errors). Otherwise, it returns the error number that stopped the link. For example, if the linker generates `LNK1104`, the linker returns 1104. Accordingly, the lowest error number returned on an error by the linker is 1000. A return value of 128 represents a configuration problem with either the operating system or a .config file; the loader didn't load either `link.exe` or `c2.dll`.
4242

@@ -46,7 +46,7 @@ You can pass command-line arguments to `link.exe` in the form of a command file.
4646

4747
> `link @commandfile`
4848
49-
The *`commandfile`* is the name of a text file. No space or tab is allowed between the at sign (**\@**) and the filename. There's no default extension; you must specify the full filename, including any extension. Wildcards can't be used. You can specify an absolute or relative path with the filename. The linker doesn't use an environment variable to search for the file.
49+
The *`commandfile`* is the name of a text file. No space or tab is allowed between the at sign (**\@**) and the filename. There's no default extension; you must specify the full filename, including any extension. Wildcards can't be used. You can specify an absolute or relative path with the filename. Must not contain more than `MAX_PATH` (260) characters. The linker doesn't use an environment variable to search for the file.
5050

5151
In the command file, arguments are separated by spaces or tabs (as on the command line) and by newline characters.
5252

docs/build/reference/linkrepro.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "/LINKREPRO (Link repro directory name)"
33
description: Linker or library tool option to set the directory for a link repro.
4-
ms.date: "09/24/2019"
4+
ms.date: 03/24/2025
55
f1_keywords: ["/LINKREPRO"]
66
helpviewer_keywords: ["LINKREPRO linker option", "/LINKREPRO linker option", "-LINKREPRO linker option", "linker repro reporting"]
77
---
@@ -16,7 +16,7 @@ Tells the linker or library tool to generate a link repro in a specified directo
1616
### Arguments
1717

1818
**/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.
19+
The user-specified directory to store the link repro in. Directory names that include spaces must be enclosed in double quotes. The *`_directory-name_`* must not exceed `MAX_PATH` (260) characters.
2020

2121
## Remarks
2222

docs/build/reference/manifestinput-specify-manifest-input.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ description: "Learn more about: /MANIFESTINPUT (Specify Manifest Input)"
33
title: "/MANIFESTINPUT (Specify Manifest Input)"
44
ms.date: 09/09/2022
55
f1_keywords: ["VC.Project.VCLinkerTool.ManifestInput"]
6-
ms.assetid: a0b0c21e-1f9b-4d8c-bb3f-178f57fa7f1b
76
---
87
# /MANIFESTINPUT (Specify Manifest Input)
98

@@ -16,7 +15,7 @@ Specifies a manifest input file to include in the manifest that's embedded in th
1615
### Parameters
1716

1817
*`filename`*\
19-
The manifest file to include in the embedded manifest.
18+
The manifest file to include in the embedded manifest. Must not exceed `MAX_PATH` (260) characters.
2019

2120
## Remarks
2221

@@ -26,5 +25,5 @@ This option can't be set directly in Visual Studio. Instead, use the **Additiona
2625

2726
## See also
2827

29-
[MSVC linker reference](linking.md)<br/>
28+
[MSVC linker reference](linking.md)\
3029
[MSVC Linker Options](linker-options.md)

docs/build/reference/natvis-add-natvis-to-pdb.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
22
description: "Learn more about: /NATVIS (Add Natvis to PDB)"
33
title: "/NATVIS (Add Natvis to PDB)"
4-
ms.date: 09/08/2022
4+
ms.date: 03/24/2025
55
f1_keywords: ["/natvis", "natvis"]
66
helpviewer_keywords: ["NATVIS linker option", "/NATVIS linker option", "-NATVIS linker option", "Add Natvis file to PDB"]
7-
ms.assetid: 8747fc0c-701a-4796-bb4d-818ab4465cca
87
---
98
# `/NATVIS` (Add Natvis to PDB)
109

@@ -17,7 +16,7 @@ Specifies a debugger visualization file (a Natvis file) to embed in the PDB file
1716
## Parameters
1817

1918
*`filename`*\
20-
The pathname for a Natvis file to add to the PDB file. It embeds the debugger visualizations in the Natvis file into the PDB.
19+
The pathname for a Natvis file to add to the PDB file. It embeds the debugger visualizations in the Natvis file into the PDB. The *`filename`* must not exceed `MAX_PATH` (260) characters.
2120

2221
## Remarks
2322

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
11
---
22
description: "Learn more about: /PDBALTPATH (Use Alternate PDB Path)"
33
title: "/PDBALTPATH (Use Alternate PDB Path)"
4-
ms.date: "11/04/2016"
4+
ms.date: 03/24/2025
55
f1_keywords: ["/pdbaltpath"]
66
helpviewer_keywords: [".pdb files, path", "PDBALTPATH dumpbin option", "-PDBALTPATH dumpbin option", "/PDBALTPATH dumpbin option", "PDB files, path"]
7-
ms.assetid: 72e200aa-e2c3-4ad8-b687-25528da1aaaf
87
---
98
# /PDBALTPATH (Use Alternate PDB Path)
109

11-
```
10+
```cmd
1211
/PDBALTPATH:pdb_file_name
1312
```
1413

1514
## Arguments
1615

17-
*pdb_file_name*<br/>
18-
The path and file name for the .pdb file.
16+
*pdb_file_name*\
17+
The path and file name for the `.pdb` file. The *`pdb_file_name`* must not exceed `MAX_PATH` (260) characters.
1918

2019
## Remarks
2120

22-
Use this option to provide an alternate location for the Program Database (.pdb) file in a compiled binary file. Normally, the linker records the location of the .pdb file in the binaries that it produces. You can use this option to provide a different path and file name for the .pdb file. The information provided with /PDBALTPATH does not change the location or name of the actual .pdb file; it changes the information that the linker writes in the binary file. This enables you to provide a path that is independent of the file structure of the build computer. Two common uses for this option are to provide a network path or a file that has no path information.
21+
Use this option to provide an alternate location for the Program Database (`.pdb`) file in a compiled binary file. Normally, the linker records the location of the `.pdb` file in the binaries that it produces. You can use this option to provide a different path and file name for the `.pdb` file. The information provided with `/PDBALTPATH` does not change the location or name of the actual `.pdb` file; it changes the information that the linker writes in the binary file. This enables you to provide a path that is independent of the file structure of the build computer. Two common uses for this option are to provide a network path or a file that has no path information.
2322

24-
The value of *pdb_file_name* can be an arbitrary string, an environment variable, or **%_PDB%**. The linker will expand an environment variable, such as **%SystemRoot%**, to its value. The linker defines the environment variables **%_PDB%** and **%_EXT%**. **%_PDB%** expands to the file name of the actual .pdb file without any path information and **%_EXT%** is the extension of the generated executable.
23+
The value of *pdb_file_name* can be an arbitrary string, an environment variable, or **%_PDB%**. The linker will expand an environment variable, such as **%SystemRoot%**, to its value. The linker defines the environment variables **%_PDB%** and **%_EXT%**. **%_PDB%** expands to the file name of the actual `.pdb` file without any path information and **%_EXT%** is the extension of the generated executable.
2524

2625
## See also
2726

28-
[DUMPBIN Options](dumpbin-options.md)<br/>
27+
[DUMPBIN Options](dumpbin-options.md)\
2928
[/PDBPATH](pdbpath.md)

0 commit comments

Comments
 (0)