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
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
8
7
---
9
8
# `/BASE` (Base address)
10
9
@@ -23,7 +22,7 @@ The **`/BASE`** linker option sets a base address for the program. It overrides
23
22
24
23
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.
25
24
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:
27
26
28
27
> *`key`**`address`*\[*`size`*]**`;`***`comment`*
29
28
@@ -35,7 +34,7 @@ one 0x28000000 0x00100000 ; for DLLONE.DLL
35
34
two 0x28100000 0x00300000 ; for DLLTWO.DLL
36
35
```
37
36
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:
39
38
40
39
```cmd
41
40
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
46
45
### To set this linker option in the Visual Studio development environment
47
46
48
47
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).
@@ -17,7 +16,7 @@ Specifies a module-definition file to the linker.
17
16
## Arguments
18
17
19
18
*`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).
21
20
22
21
## Remarks
23
22
@@ -28,9 +27,7 @@ To specify a *`.def`* file from within the development environment, add it to th
28
27
### To set this linker option in the Visual Studio development environment
29
28
30
29
1. Open the project's **Property Pages** dialog box. For more information, see [Set compiler and build properties](../working-with-project-properties.md).
@@ -43,7 +43,7 @@ Use **`PATH`** to specify a separate set of PGO counters for each unique path t
43
43
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`** .
44
44
45
45
**`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).
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
19
15
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).
22
21
23
22
## Remarks
24
23
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.
26
25
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.
28
27
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:
30
29
31
30
-*filename*.tlb
32
-
33
31
-*filename*_p.c
34
-
35
32
-*filename*_i.c
36
-
37
33
-*filename*.h
38
34
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`*.
40
36
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.
42
38
43
39
### To set this linker option in the Visual Studio development environment
44
40
45
41
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).
helpviewer_keywords: ["Name incremental database file in C++ linker", "/ILK linker option", "-ILK linker option", "ILK linker option"]
7
7
---
@@ -16,7 +16,7 @@ The **`/ILK`** linker option tells the linker where to put the *`.ilk`* database
16
16
### Arguments
17
17
18
18
*`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).
20
20
21
21
## Remarks
22
22
@@ -25,9 +25,7 @@ The **`/ILK`** linker option tells the linker the path and filename to use for t
25
25
### To set this compiler option in the Visual Studio development environment
26
26
27
27
1. Open the project **Property Pages** dialog box. For more information, see [Set compiler and build properties](../working-with-project-properties.md).
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).
17
18
18
19
## Remarks
19
20
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:
21
22
22
23
- The [__declspec(dllexport)](../../cpp/dllexport-dllimport.md) keyword in the source code
23
-
24
24
-[EXPORTS](exports.md) statement in a .def file
25
-
26
25
- An [/EXPORT](export-exports-a-function.md) specification in a LINK command
27
26
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).
29
28
30
29
### To set this linker option in the Visual Studio development environment
31
30
32
31
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).
0 commit comments